コード例 #1
0
        public ResponseBase EnableRemoteDesktop()
        {
            ResponseBase response;

            try {
                NTMinerRegistry.SetIsRdpEnabled(true);
                if (IsNTMinerOpened())
                {
                    RpcRoot.JsonRpc.FirePostAsync(NTKeyword.Localhost, NTKeyword.MinerClientPort, _minerClientControllerName, nameof(IMinerClientController.RefreshIsRemoteDesktopEnabled), null, data: null, timeountMilliseconds: 3000);
                }
                response = ResponseBase.Ok("开启Windows远程桌面");
            }
            catch (Exception e) {
                Logger.ErrorDebugLine(e);
                response = ResponseBase.ServerError(e.Message);
            }
            VirtualRoot.OperationResultSet.Add(response.ToOperationResult());
            return(response);
        }