NET_DVR_GetDVRConfig 获取设备配置信息的两种方式

方式一:

        [DllImportAttribute("HCNetSDK.dll", EntryPoint = "NET_DVR_GetDVRConfig", CallingConvention = CallingConvention.StdCall)]
        [return: MarshalAsAttribute(UnmanagedType.Bool)]
        public static extern bool NET_DVR_GetDVRConfig(int lUserID, uint dwCommand, int lChannel,IntPtr lpOutBuffer, uint dwOutBufferSize, ref uint lpBytesReturned);
 

 

           uint dwReturned=0; //初始化实际接收的数据长度指针
            IntPtr lptr;
            HikClient.HCNetSDK.NET_DVR_USER_V30 PICCFG = new HikClient.HCNetSDK.NET_DVR_USER_V30();
            int size = Marshal.SizeOf(PICCFG);//返回对象的大小
            lptr = Marshal.AllocHGlobal(size);//根据大小分配内存
            if (NET_DVR_GetDVRConfig(lUserID, 1006, 通道编号, lptr, (uint)size, ref dwReturned)) ;
            {
                PICCFG = (HikClient.HCNetSDK.NET_DVR_USER_V30)Marshal.PtrToStructure(lptr, typeof(HikClient.HCNetSDK.NET_DVR_USER_V30));
           }
            Marshal.FreeHGlobal(lptr);
            MessageBox.Show(PICCFG.dwSize.ToString());

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/dj277705362/article/details/5635478
文章标签: user
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭