Beispiel #1
0
 // 将DateTime 转 DVR时间
 private HCNetSDK.NET_DVR_TIME DateTimeToDvrTime(DateTime dt)
 {
     HCNetSDK.NET_DVR_TIME dvrTime = new HCNetSDK.NET_DVR_TIME();
        dvrTime.dwYear = (uint)dt.Year;
        dvrTime.dwMonth = (uint)dt.Month;
        dvrTime.dwDay = (uint)dt.Day;
        dvrTime.dwHour = (uint)dt.Hour;
        dvrTime.dwMinute = (uint)dt.Minute;
        dvrTime.dwSecond = (uint)dt.Second;
        return dvrTime;
 }
Beispiel #2
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;
 }