带摄像头IP设备的阵列

带摄像头IP设备的阵列

本文介绍了带摄像头IP设备的阵列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi , I have a function inside a windows service in visual studio 2017 that captures alarms from a security camera, when I want to get an IP from the camera it returns a number "48" which is the sum of the numbers of IP 192.168.xx.xx, but I need not that number but the IP in a char [16] , some data that I need to change the code ?, I only get a number 48 in the position m_storeDev [0],functions get data from the cameras with communication SDK  C++ 







cDeviceIP[0] = 48 (it is the sum of the numbers of IP 192.168.xx.xx)
cDeviceIP[1] = 0
cDeviceIP[2] = 0
cDeviceIP[3] = 0
cDeviceIP[4] = 0
cDeviceIP[5] = 0
cDeviceIP[6] = 0
cDeviceIP[7] = 0
cDeviceIP[8] = 0
cDeviceIP[9] = 0
cDeviceIP[10] = 0
cDeviceIP[11] = 0
cDeviceIP[12] = 0
cDeviceIP[13] = 0
cDeviceIP[14] = 0
cDeviceIP[15] = 0

I need to have the IP numbers in each position of the array m_storeDev[16]





我尝试过:



Declation struct(NVSSDK.dll)



What I have tried:

Declation struct (NVSSDK.dll)

[StructLayout(LayoutKind.Sequential)]
    public struct PNVS_NFS_DEV
    {
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
        public Char[] cDeviceIP;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 250)]
        public Char[] cStorePath;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
        public Char[] cUsername;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
        public Char[] cPassword;
        public int iState;
    };





来自Windows服务的电话



Call from Windows Service

PNVS_NFS_DEV m_storeDev;
int iRetx1 = NVSSDK.NetClient_NetFileGetMapStoreDevice(_ulLogonID, ref m_storeDev);

推荐答案


这篇关于带摄像头IP设备的阵列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-02 16:13