C# 海康DVR客户端开发系列(2)―― 封装API (2)

 /// </summary>
            public byte bySendMode;
            
/// <summary>
            
/// 解码设备连接的服务器的通道号
            
/// </summary>
            public byte byEncoderChannel;
            
/// <summary>
            
/// 解码设备连接的服务器的端口号
            
/// </summary>
            public ushort wEncoderPort;
            
/// <summary>
            
/// 保留
            
///     public byte reservedData[4];
            
/// </summary>
            public byte[] reservedData;
        }

        
/// <summary>
        
/// NET_DVR_DECODERSTATE, *LPNET_DVR_DECODERSTATE;
        
/// </summary>
        public struct NET_DVR_DECODERSTATE
        {
            
/// <summary>
            
/// 解码设备连接的服务器IP
            
///     public byte byEncoderIP[16];
            
/// </summary>
            public byte[] byEncoderIP;
            
/// <summary>
            
/// 解码设备连接的服务器的用户名
            
///     public byte byEncoderUser[16];
            
/// </summary>
            public byte[] byEncoderUser;
            
/// <summary>
            
/// 解码设备连接的服务器的密码
            
///     public byte byEncoderPasswd[16];
            
/// </summary>
            public byte[] byEncoderPasswd;
            
/// <summary>
            
/// 解码设备连接的服务器的通道号
            
/// </summary>
            public byte byEncoderChannel;
            
/// <summary>
            
/// 解码设备连接的服务器的连接模式
            
/// </summary>
            public byte bySendMode;
            
/// <summary>
            
/// 解码设备连接的服务器的端口号
            
/// </summary>
            public ushort wEncoderPort;
            
/// <summary>
            
/// 解码设备连接服务器的状态
            
/// </summary>
            public uint dwConnectState;
            
/// <summary>
            
/// 保留
            
///     public byte reservedData[4];
            
/// </summary>
            public byte[] reservedData;
        }

        
#region 解码设备控制码定义
        
public const int NET_DEC_STARTDEC = 1;
        
public const int NET_DEC_STOPDEC = 2;
        
public const int NET_DEC_STOPCYCLE = 3;
        
public const int NET_DEC_CONTINUECYCLE = 4;
        
#endregion


        
#endregion

        
/// <summary>
        
/// Email
        
///     NET_DVR_EMAILPARA, *LPNET_DVR_EMAILPARA;
        
/// </summary>
        public struct NET_DVR_EMAILPARA
        {
            
/// <summary>
            
/// 邮件账号
            
///     public byte sUsername[64];
            
/// </summary>
            public string sUsername;
            
/// <summary>
            
/// 邮件密码
            
///     public byte sPassword[64];
            
/// </summary>
            public string sPassword;
            
/// <summary>
            
///     public byte sSmtpServer[64];
            
/// </summary>
            public string sSmtpServer;
            
/// <summary>
            
///     public byte sPop3Server[64];
            
/// </summary>
            public string sPop3Server;
            
/// <summary>
            
/// 邮件地址
            
///     public byte sMailAddr[64];
            
/// </summary>
            public string sMailAddr;
            
/// <summary>
            
/// 上传报警/异常等的email
            
///     public byte sEventMailAddr1[64];
            
/// </summary>
            public byte[] sEventMailAddr1;
            
/// <summary>
            
///     public byte sEventMailAddr2[64];
            
/// </summary>
            public byte[] sEventMailAddr2;
            
/// <summary>
            
///     public byte res[16];
            
/// </summary>
            public byte[] res;
        }

        
/// <summary>
        
/// NET_DVR_NETCFG_OTHER, *LPNET_DVR_NETCFG_OTHER;
        
/// </summary>
        public struct NET_DVR_NETCFG_OTHER
        {
            
public uint dwSize;
            
/// <summary>
            
///     char    sFirstDNSIP[16];
            
/// </summary>
            public string sFirstDNSIP;
            
/// <summary>
            
///     char    sSecondDNSIP[16];
            
/// </summary>
            public string sSecondDNSIP;
            
/// <summary>
            
/// char    sRes[32];
            
/// </summary>
            public string sRes;
        }

        
/// <summary>
        
/// 连接的通道配置 2007-11-05
        
///     NET_DVR_MATRIX_DECCHANINFO, *LPNET_DVR_MATRIX_DECCHANINFO;
        
/// </summary>
        public struct NET_DVR_MATRIX_DECCHANINFO
        {
            
/// <summary>
            
/// 是否启用 0-否 1-启用
            
/// </summary>
            public uint dwEnable;
            
/// <summary>
            
/// 轮循解码通道信息
            
/// </summary>
            public NET_DVR_MATRIX_DECINFO struDecChanInfo;
        }
        
/// <summary>
        
/// 压缩参数?
        
///     NET_DVR_COMPRESSIONCFG_NEW, *LPNET_DVR_COMPRESSIONCFG_NEW;
        
/// </summary>
        public struct NET_DVR_COMPRESSIONCFG_NEW
        {
            
public uint dwSize;
            
/// <summary>
            
/// 定时录像
            
/// </summary>
            public NET_DVR_COMPRESSION_INFO_EX struLowCompression;
            
/// <summary>
            
/// 事件触发录像
            
/// </summary>
            public NET_DVR_COMPRESSION_INFO_EX struEventCompression;
        }
        
/// <summary>
        
/// 抓图模式
        
/// </summary>
        public enum CAPTURE_MODE
        {
            
/// <summary>
            
/// BMP模式
            
/// </summary>
            BMP_MODE = 0,        //
            /// <summary>
            
/// JPEG模式 
            
/// </summary>
            JPEG_MODE = 1        //
        }
        
/// <summary>
        
/// 实时声音模式
        
/// </summary>
        public enum REALSOUND_MODE
        {
            
/// <summary>
            
/// 独占模式
            
/// </summary>
            MONOPOLIZE_MODE = 1,
            
/// <summary>
            
/// 共享模式
            
/// </summary>
            SHARE_MODE = 2
        }
        
/// <summary>
        
/// 录象文件参数(带卡号)
        
///     NET_DVR_FINDDATA_CARD, *LPNET_DVR_FINDDATA_CARD;
        
/// </summary>
        public struct NET_DVR_FINDDATA_CARD
        {
            
/// <summary>
            
/// 文件名
            
///     char sFileName[100];
            
/// </summary>
            public string sFileName;
            
/// <summary>
            
/// 文件的开始时间
            
/// </summary>
            public NET_DVR_TIME struStartTime;
            
/// <summary>
            
/// 文件的结束时间
            
/// </summary>
            public NET_DVR_TIME struStopTime;
            
/// <summary>
            
/// 文件的大小
            
/// </summary>
            public uint dwFileSize;
            
/// <summary>
            
/// 卡号?
            
///     char sCardNum[32];
            
/// </summary>
            public char sCardNum;
        }

        
/// <summary>
        
/// 设置重新连接间隔
        
///     NET_DVR_API BOOL __stdcall NET_DVR_SetReconnect(DWORD dwInterval = 30000, BOOL bEnableRecon = TRUE);
        
/// </summary>
        
/// <param name="dwInterval"></param>
        
/// <param name="bEnableRecon"></param>
        
/// <returns></returns>
        [DllImport("HCNetSDK.dll")]
        
public static extern bool NET_DVR_SetReconnect(uint dwInterval, bool bEnableRecon);
        
/// <summary>
        
/// 通过IPSever获取设备动态IP地址[Ex]
        
///     NET_DVR_API BOOL  __stdcall NET_DVR_GetDVRIPByResolveSvr_EX(char *sServerIP, WORD wServerPort, unsigned char *sDVRName, WORD wDVRNameLen, BYTE *sDVRSerialNumber, WORD wDVRSerialLen, char* sGetIP, DWORD *dwPort);
        
/// </summary>
        
/// <param name="sServerIP"></param>
        
/// <param name="wServerPort"></param>
        
/// <param name="sDVRName"></param>
        
/// <param name="wDVRNameLen"></param>
        
/// <param name="sDVRSerialNumber"></param>
        
/// <param name="wDVRSerialLen"></param>
        
/// <param name="sGetIP"></param>
        
/// <param name="dwPort"></param>
        
/// <returns></returns>
        [DllImport("HCNetSDK.dll")]

你可能感兴趣的:(C#,职场,客户端,休闲,DVR)