From f11056c469dae41dcb39370fd8260c3c9d3f99a4 Mon Sep 17 00:00:00 2001 From: liufei Date: Thu, 19 Aug 2021 14:49:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E5=8A=A8=E7=94=BB,=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=90=8E=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=BB=E7=95=8C=E9=9D=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/UserControls/PannelCard/RightCardControl.xaml.cs | 8 ++++---- GeekDesk.csproj | 1 + Util/HttpUtil.cs | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml.cs b/Control/UserControls/PannelCard/RightCardControl.xaml.cs index aa40048..f02fa77 100644 --- a/Control/UserControls/PannelCard/RightCardControl.xaml.cs +++ b/Control/UserControls/PannelCard/RightCardControl.xaml.cs @@ -135,12 +135,12 @@ namespace GeekDesk.Control.UserControls.PannelCard { if (!MainWindow.hide.IsMargin()) { - MainWindow.mainWindow.Visibility = Visibility.Collapsed; + MainWindow.HideApp(); } } else { - MainWindow.mainWindow.Visibility = Visibility.Collapsed; + MainWindow.HideApp(); } } @@ -153,11 +153,11 @@ namespace GeekDesk.Control.UserControls.PannelCard { if (!MainWindow.hide.IsMargin()) { - MainWindow.mainWindow.Visibility = Visibility.Collapsed; + MainWindow.HideApp(); } } else { - MainWindow.mainWindow.Visibility = Visibility.Collapsed; + MainWindow.HideApp(); } } break; diff --git a/GeekDesk.csproj b/GeekDesk.csproj index 40b96b8..88712c6 100644 --- a/GeekDesk.csproj +++ b/GeekDesk.csproj @@ -70,6 +70,7 @@ packages\System.Drawing.Common.6.0.0-preview.6.21352.12\lib\net461\System.Drawing.Common.dll + diff --git a/Util/HttpUtil.cs b/Util/HttpUtil.cs index 3112f56..c6cd2d8 100644 --- a/Util/HttpUtil.cs +++ b/Util/HttpUtil.cs @@ -17,11 +17,12 @@ namespace GeekDesk.Util ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; //创建Web访问对 象 HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url); + myRequest.ContentType = "text/plain; charset=gbk"; //通过Web访问对象获取响应内容 HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse(); //通过响应内容流创建StreamReader对象,因为StreamReader更高级更快 - StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8); + StreamReader reader = new StreamReader(myResponse.GetResponseStream(), Encoding.GetEncoding("gbk")); string returnStr = reader.ReadToEnd();//利用StreamReader就可以从响应内容从头读到尾 reader.Close(); myResponse.Close();