/// <summary> /// 设置硬盘录像机的参数 /// </summary> /// <param name="lUserID">NET_DVR_Login ()的返回值</param> /// <param name="dwCommand">参数类型</param> /// <param name="lChannel">通道号,如果不是通道参数,lChannel 不用,置为0 即可</param> /// <param name="lpInBuffer">存放输入参数的缓冲区</param> /// <param name="dwInBufferSize">缓冲区的大小</param> /// <returns>返回值:TRUE 表示成功,FALSE 表示失败。</returns> public bool SetDVRConfig(Int32 lUserID, Int32 dwCommand, Int32 lChannel, IntPtr lpInBuffer, Int32 dwInBufferSize) { Type typeAlarm = typeof(SDKPlugInData.SystemTime); object obj = Marshal.PtrToStructure(lpInBuffer, typeAlarm); SDKPlugInData.SystemTime systemtime1 = (SDKPlugInData.SystemTime)obj; DateTime datetime = Convert.ToDateTime(string.Format("{0}-{1}-{2} {3}:{4}:{5}", systemtime1.wYear, systemtime1.wMonth, systemtime1.wDay, systemtime1.wHour, systemtime1.wMinute, systemtime1.wSecond)); TIME_PARAM time_param = new TIME_PARAM(); time_param.m_year = systemtime1.wYear; time_param.m_month = (byte)systemtime1.wMonth; time_param.m_dayofmonth = (byte)systemtime1.wDay; time_param.m_dayofweek = (byte)datetime.DayOfWeek; time_param.m_hour = (byte)systemtime1.wHour; time_param.m_minute = (byte)systemtime1.wMinute; time_param.m_second = (byte)systemtime1.wSecond; time_param.bReceive = new byte[2]; return VSNET_ClientSetSystime("wangluogaosuqiu", hashtable_ip[lUserID].ToString(), hashtable_username[lUserID].ToString(), hashtable_password[lUserID].ToString(), ref time_param, (ushort)(hashtable_port[lUserID])); }
private static extern bool VSNET_ClientSetSystime(string m_sername, string m_url, string m_username, string m_password, ref TIME_PARAM m_pSetPara, ushort wserport);