Exemple #1
0
        /// <summary>
        /// 获取报警主机布防状态,传入登陆ID
        /// </summary>
        /// <param name="_LoginID"></param>
        /// <returns></returns>
        public Dictionary <int, string> GetDefenceArmMode(IntPtr _LoginID)
        {
            Dictionary <int, string> dic     = new Dictionary <int, string>();
            NET_IN_GET_DEFENCEMODE   stuinfo = new NET_IN_GET_DEFENCEMODE()
            {
                dwSize = (uint)Marshal.SizeOf(typeof(NET_IN_GET_DEFENCEMODE)),
            };

            stuinfo.anDefence   = new int[128];
            stuinfo.nDefenceNum = 128;
            for (int i = 0; i < stuinfo.nDefenceNum; ++i)
            {
                stuinfo.anDefence[i] = i; //赋值通道号,通道号从0开始,0,1,2,3....,也代表该通道编号
            }

            NET_OUT_GET_DEFENCEMODE stuOutInfo = new NET_OUT_GET_DEFENCEMODE()
            {
                dwSize = (uint)Marshal.SizeOf(typeof(NET_OUT_GET_DEFENCEMODE)),
            };

            bool result = NETClient.GetDefenceArmMode(_LoginID, stuinfo, ref stuOutInfo, 3000);

            if (!result)
            {
                dic.Add(-1, "获取失败");
            }
            else
            {
                for (int i = 0; i < stuOutInfo.nDefenceNum; ++i)
                {
                    dic.Add(i, stuOutInfo.anDefenceState[i].ToString());
                }
            }
            return(dic);
        }
 public static extern bool CLIENT_GetDefenceArmMode(IntPtr lLoginID, ref NET_IN_GET_DEFENCEMODE pInParam, ref NET_OUT_GET_DEFENCEMODE pOutParam, int nWaitTime);