• 大小: 8.76M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-06-19
  • 语言: C#
  • 标签:

资源简介

海康威视监听布防示例(车牌抓拍)

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.IO;

namespace AlarmCSharpDemo
{
    public partial class AlarmDemo : Form
    {
        private Int32 m_lUserID = -1;
        private Int32[] m_lAlarmHandle = new Int32[200];
        private Int32 iListenHandle = -1; 
        private int iDeviceNumber = 0; //添加设备个数
        private int iFileNumber = 0; //保存的文件个数
        private uint iLastErr = 0;
        private string strErr;

        public CHCNetSDK.LOGINRESULTCALLBACK LoginCallBack = null;
        private CHCNetSDK.EXCEPYIONCALLBACK m_fExceptionCB = null;
        private CHCNetSDK.MSGCallBack_V31 m_falarmData_V31 = null;
        private CHCNetSDK.MSGCallBack m_falarmData = null;

        public delegate void UpdateTextStatusCallback(string strLogStatus IntPtr lpDeviceInfo);
        public delegate void UpdateListBoxCallback(string strAlarmTime string strDevIP string strAlarmMsg);
        public delegate void UpdateListBoxCallbackException(string strAlarmTime int lUserID string strAlarmMsg);

        CHCNetSDK.NET_VCA_TRAVERSE_PLANE m_struTraversePlane = new CHCNetSDK.NET_VCA_TRAVERSE_PLANE();
        CHCNetSDK.NET_VCA_AREA m_struVcaArea = new CHCNetSDK.NET_VCA_AREA();
        CHCNetSDK.NET_VCA_INTRUSION m_struIntrusion = new CHCNetSDK.NET_VCA_INTRUSION();
        CHCNetSDK.UNION_STATframe m_struStatframe = new CHCNetSDK.UNION_STATframe();
        CHCNetSDK.UNION_STATTIME m_struStatTime = new CHCNetSDK.UNION_STATTIME();
        public AlarmDemo()
        {
            InitializeComponent();
            bool m_bInitSDK = CHCNetSDK.NET_DVR_Init();
            if (m_bInitSDK == false)
            {
                MessageBox.Show(“NET_DVR_Init error!“);
                return;
            }
            else
            {
                byte[] strIP = new byte[16 * 16];
                uint dwValidNum=0;
                Boolean bEnableBind=false;

                //获取本地PC网卡IP信息
                if (CHCNetSDK.NET_DVR_GetLocalIP(strIP ref dwValidNum ref bEnableBind))
                {
                    if (dwValidNum > 0)
                    {
                        //取第一张网卡的IP地址为默认监听端口
                        textBoxListenIP.Text = System.Text.Encoding.UTF8.GetString(strIP 0 16);
                        //CHCNetSDK.NET_DVR_SetValidIP(0true); //绑定第一张网卡
                    }
                
                }

                //保存SDK日志 To save the SDK log
                CHCNetSDK.NET_DVR_SetLogToFile(3 “C:\\SdkLog\\“ true);

                //设置透传报警信息类型
                CHCNetSDK.NET_DVR_LOCAL_GENERAL_CFG struLocalCfg = new CHCNetSDK.NET_DVR_LOCAL_GENERAL_CFG();
                struLocalCfg.byAlarmJsonPictureSeparate = 1;//控制JSON透传报警数据和图片是否分离,0-不分离(COMM_VCA_ALARM返回),1-分离(分离后走COMM_

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2022-04-27 11:30  4-报警布防监听\
     目录           0  2021-04-25 20:20  4-报警布防监听\.vs\
     目录           0  2021-04-25 20:20  4-报警布防监听\.vs\AlarmCSharpDemo\
     目录           0  2022-04-27 11:30  4-报警布防监听\.vs\AlarmCSharpDemo\v14\
     文件       18432  2019-01-22 14:52  4-报警布防监听\.vs\AlarmCSharpDemo\v14\.suo
     目录           0  2022-04-27 11:30  4-报警布防监听\AlarmCSharpDemo\
     文件        3833  2019-12-03 14:00  4-报警布防监听\AlarmCSharpDemo\AlarmCSharpDemo.csproj
     文件        4608  2022-04-24 17:34  4-报警布防监听\AlarmCSharpDemo\AlarmCSharpDemo.suo
     文件       21056  2019-12-21 13:29  4-报警布防监听\AlarmCSharpDemo\AlarmDemo.Designer.cs
     文件       94435  2020-12-30 11:47  4-报警布防监听\AlarmCSharpDemo\AlarmDemo.cs
     文件        5817  2019-12-21 13:29  4-报警布防监听\AlarmCSharpDemo\AlarmDemo.resx
     文件      925209  2020-12-30 14:18  4-报警布防监听\AlarmCSharpDemo\CHCNetSDK.cs
     文件         491  2015-09-10 14:12  4-报警布防监听\AlarmCSharpDemo\Program.cs
     目录           0  2022-04-27 11:30  4-报警布防监听\AlarmCSharpDemo\Properties\
     文件        1442  2015-09-10 14:12  4-报警布防监听\AlarmCSharpDemo\Properties\AssemblyInfo.cs
     文件        2859  2015-09-10 14:12  4-报警布防监听\AlarmCSharpDemo\Properties\Resources.Designer.cs
     文件        5612  2015-09-10 14:12  4-报警布防监听\AlarmCSharpDemo\Properties\Resources.resx
     文件        1101  2015-09-10 14:12  4-报警布防监听\AlarmCSharpDemo\Properties\Settings.Designer.cs
     文件         249  2015-09-10 14:12  4-报警布防监听\AlarmCSharpDemo\Properties\Settings.settings
     目录           0  2022-04-27 11:30  4-报警布防监听\AlarmCSharpDemo\bin\
     文件      274432  2019-12-21 14:03  4-报警布防监听\AlarmCSharpDemo\bin\AlarmCSharpDemo.exe
     文件      114176  2022-04-02 10:46  4-报警布防监听\AlarmCSharpDemo\bin\AlarmCSharpDemo.pdb
     文件       11608  2022-04-27 11:28  4-报警布防监听\AlarmCSharpDemo\bin\AlarmCSharpDemo.vshost.exe
     文件         490  2015-10-22 09:54  4-报警布防监听\AlarmCSharpDemo\bin\AlarmCSharpDemo.vshost.exe.manifest
     文件      144384  2015-07-22 10:25  4-报警布防监听\AlarmCSharpDemo\bin\AudioRender.dll
     文件      200480  2021-03-02 15:52  4-报警布防监听\AlarmCSharpDemo\bin\GdiPlus.lib
     文件     2062336  2021-03-02 16:10  4-报警布防监听\AlarmCSharpDemo\bin\HCCore.dll
     文件      304980  2021-03-02 16:10  4-报警布防监听\AlarmCSharpDemo\bin\HCCore.lib
     文件      847360  2021-03-02 16:12  4-报警布防监听\AlarmCSharpDemo\bin\HCNetSDK.dll
     文件      229388  2021-03-02 16:12  4-报警布防监听\AlarmCSharpDemo\bin\HCNetSDK.lib
     文件     1867264  2021-03-02 15:52  4-报警布防监听\AlarmCSharpDemo\bin\HXVA.dll
............此处省略35个文件信息

评论

共有 条评论

相关资源