Esempio n. 1
0
        public int SDK_ConfigTime(int year, int month, int day, int hour, int minute, int second)
        {
            HCNetSDK.NET_DVR_TIME dvrTime = new HCNetSDK.NET_DVR_TIME();
            dvrTime.dwYear   = (uint)year;
            dvrTime.dwMonth  = (uint)month;
            dvrTime.dwDay    = (uint)day;
            dvrTime.dwHour   = (uint)hour;
            dvrTime.dwMinute = (uint)minute;
            dvrTime.dwSecond = (uint)second;
            byte[] buf = HCNetSDK.StructToBytes(dvrTime);
            bool   ret = HCNetSDK.NET_DVR_SetDVRConfig(_user_id, HCNetSDK.NET_DVR_SET_TIMECFG, 0, buf, (uint)buf.Length);

            return(0);
        }
Esempio n. 2
0
 //设置设备时间
 public bool ConfigTime(DateTime dt)
 {
     HCNetSDK.NET_DVR_TIME dvrTime = DateTimeToDvrTime(dt);
     byte[] buf = HCNetSDK.StructToBytes(dvrTime);
     return(HCNetSDK.NET_DVR_SetDVRConfig(_user_id, HCNetSDK.NET_DVR_SET_TIMECFG, 0, buf, (uint)buf.Length));
 }