Example #1
0
 public void SaveGpuProfilesJson()
 {
     try {
         string json = Request.Content.ReadAsStringAsync().Result;
         SpecialPath.SaveGpuProfilesJsonFile(json);
         if (IsNTMinerOpened())
         {
             using (HttpClient client = new HttpClient()) {
                 Task <HttpResponseMessage> message = client.PostAsync($"http://localhost:{Consts.MinerClientPort}/api/MinerClient/OverClock", null);
                 Write.DevDebug($"{nameof(SaveGpuProfilesJson)} {message.Result.ReasonPhrase}");
             }
         }
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
     }
 }
 public void SaveGpuProfilesJson()
 {
     try {
         Logger.InfoDebugLine("保存显卡参数");
         string json = Request.Content.ReadAsStringAsync().Result;
         SpecialPath.SaveGpuProfilesJsonFile(json);
         if (IsNTMinerOpened())
         {
             using (HttpClient client = RpcRoot.CreateHttpClient()) {
                 Task <HttpResponseMessage> getHttpResponse = client.PostAsync($"http://localhost:{NTKeyword.MinerClientPort.ToString()}/api/MinerClient/OverClock", null);
                 Write.DevDebug($"{nameof(SaveGpuProfilesJson)} {getHttpResponse.Result.ReasonPhrase}");
             }
         }
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
     }
 }