Exemple #1
0
        /// <summary>
        /// 单防区撤布防设置
        /// </summary>
        /// <param name="_LoginID">登陆ID</param>
        /// <param name="InChannel">设定通道ID</param>
        /// <param name="password">报警主机密码</param>
        /// <param name="DefenceState">操作状态 1表示布防,2表示撤防</param>
        /// <returns></returns>
        public bool SetDefenceArmMode(IntPtr _LoginID, int InChannel, string password, int DefenceState)
        {
            NET_IN_SET_DEFENCEMODE stuinfo = new NET_IN_SET_DEFENCEMODE()
            {
                dwSize = (uint)Marshal.SizeOf(typeof(NET_IN_SET_DEFENCEMODE)),
            };

            stuinfo.nChannel = Convert.ToInt32(InChannel);

            stuinfo.szPassword = password;

            stuinfo.emDefenceMode = (EM_DEFENCEMODE)(Convert.ToInt32(DefenceState));

            bool result = NETClient.SetDefenceArmMode(_LoginID, stuinfo, 3000);

            if (!result)
            {
                Console.WriteLine("SetDefenceArmMode 失败");
                Console.WriteLine("失败错误码,error:{0}", NETClient.GetLastError());
                return(false);
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Green;
                Console.WriteLine("SetDefenceArmMode 成功!");
                return(true);
            }
        }
 public static extern bool CLIENT_SetDefenceArmMode(IntPtr lLoginID, ref NET_IN_SET_DEFENCEMODE pInParam, ref NET_OUT_SET_DEFENCEMODE pOutParam, int nWaitTime);