修复 开启窗口动画,启动项目后无法显示主界面bug
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user