示例#1
0
        private string SendCommand(byte[] datas, CommandConst name, int returnLength, string devicecode, object extInfo)
        {
            string msg = string.Empty;

            if (remoteCommand != null)
            {
                try
                {
                    //bool result = remoteCommand.SendCommand(datas, name, returnLength, CurrentUser.UserCode, currentDevice.Code, null);
                    bool result = remoteCommand.SendCommand(datas, name, returnLength, "WebAdminZ2", devicecode, extInfo);
                    if (!result)
                    {
                        msg = "请求失败!";
                    }
                }
                catch (Exception ex)
                {
                    msg = "请求异常:" + ex.Message;
                }
            }
            else
            {
                this.status = false;
                msg         = "远程对象出错,请重试!";
            }

            return(msg);
        }
示例#2
0
        private string SendCommand(byte[] datas, CommandConst name, int returnLength, string devicecode, object extInfo)
        {
            string msg = string.Empty;

            if (remoteCommand != null)
            {
                //if (!CreateCommandClient())
                //{
                //    return "远程命令对象创建失败";
                //}
                try
                {
                    //bool result = remoteCommand.SendCommand(datas, name, returnLength, CurrentUser.UserCode, currentDevice.Code, null);
                    bool result = remoteCommand.SendCommand(datas, name, returnLength, commandClient.Sender, devicecode, extInfo);
                    if (!result)
                    {
                        msg = "请求失败!";
                    }
                }
                catch (Exception ex)
                {
                    msg = "请求异常:" + ex.Message;
                }
            }
            else
            {
                msg = "远程对象出错,请重试!";
            }

            return(msg);
        }