public MonitorMain() { InitializeComponent(); m_bInitSDK = CHCNetSDK.NET_DVR_Init(); if (m_bInitSDK == false) { MessageBox.Show("NET_DVR_Init error!"); return; } else { //保存SDK日志 To save the SDK log CHCNetSDK.NET_DVR_SetLogToFile(3, "K:\\SdkLog\\", true); } cam1 = getCamConf(iniPath, "region1_cam1"); cam2 = getCamConf(iniPath, "region1_cam2"); cam3 = getCamConf(iniPath, "region1_cam3"); cam4 = getCamConf(iniPath, "region1_cam4"); cam5 = getCamConf(iniPath, "region1_cam5"); cam6 = getCamConf(iniPath, "region1_cam6"); GetDevInfo(ref dev1, cam1); GetDevInfo(ref dev2, cam2); GetDevInfo(ref dev3, cam3); GetDevInfo(ref dev4, cam4); GetDevInfo(ref dev5, cam5); GetDevInfo(ref dev6, cam6); }
private void GetDevInfo(ref DevInfo devInfo, CamConf camConf) { devInfo.UserID = camConf.UserID; devInfo.IP = camConf.IPAddress; devInfo.StreamType = 0.ToString(); devInfo.Port = camConf.Port; devInfo.Password = camConf.Pwd; }
public CamConf getCamConf(string filePath, string section) { CamConf tmp = new CamConf(); string def = null; tmp.IPAddress = IniFileDll.IniFileDll.Read(section, "IPAddress", def, filePath); tmp.Port = IniFileDll.IniFileDll.Read(section, "Port", def, filePath); tmp.UserID = IniFileDll.IniFileDll.Read(section, "UserID", def, filePath); tmp.Pwd = IniFileDll.IniFileDll.Read(section, "Pwd", def, filePath); return(tmp); }