소스 검색

解决#155

ntminer 4 년 전
부모
커밋
e1dfe1a17a
2개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/AppModels/Vms/GpuStatusBarViewModel.cs
  2. 3 0
      src/CalcConfigUpdater/Program.cs

+ 3 - 0
src/AppModels/Vms/GpuStatusBarViewModel.cs

@@ -71,6 +71,9 @@ namespace NTMiner.Vms {
                 if (WpfUtil.IsInDesignMode) {
                     return string.Empty;
                 }
+                if (NTMinerContext.Instance.GpuSet.GpuType == GpuType.Empty) {
+                    return "没有矿卡或矿卡未驱动";
+                }
                 return NTMinerContext.Instance.GpuSet.GpuType.GetDescription();
             }
         }

+ 3 - 0
src/CalcConfigUpdater/Program.cs

@@ -5,6 +5,7 @@ using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
+using System.Net;
 using System.Net.Http;
 using System.Text;
 using System.Text.RegularExpressions;
@@ -290,6 +291,8 @@ namespace NTMiner {
 
         private static async Task<byte[]> GetHtmlAsync(string url) {
             try {
+                // 没有这一行可能会报错:System.Net.WebException: 请求被中止: 未能创建 SSL/TLS 安全通道
+                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
                 using (HttpClient client = RpcRoot.CreateHttpClient()) {
                     client.Timeout = TimeSpan.FromSeconds(20);
                     return await client.GetByteArrayAsync(url);