From 40549f65af402cf613f06f141d3108c93b249aa5 Mon Sep 17 00:00:00 2001 From: j502647092 Date: Thu, 30 Jul 2015 20:49:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DHttpHelper...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CTZLauncher/HttpHelper.cs | 14 +++++++------- CTZLauncher/MainWindow.xaml.cs | 7 ++++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CTZLauncher/HttpHelper.cs b/CTZLauncher/HttpHelper.cs index 04c0cc9..52d0ce9 100644 --- a/CTZLauncher/HttpHelper.cs +++ b/CTZLauncher/HttpHelper.cs @@ -42,13 +42,13 @@ namespace CityCraft } public class HttpHelper { - public static HttpReadyState readyState = HttpReadyState.未初始化; - public static int Status = 0; - public static string responseBody = ""; - public static string responseText = ""; - public static byte[] responseByte = null; - public static HttpArgs args = new HttpArgs(); - public static string ErrMsg = string.Empty; + public HttpReadyState readyState = HttpReadyState.未初始化; + public int Status = 0; + public string responseBody = ""; + public string responseText = ""; + public byte[] responseByte = null; + public HttpArgs args = new HttpArgs(); + public string ErrMsg = string.Empty; /// /// 提交方法 /// diff --git a/CTZLauncher/MainWindow.xaml.cs b/CTZLauncher/MainWindow.xaml.cs index df733d8..7bcc6d5 100644 --- a/CTZLauncher/MainWindow.xaml.cs +++ b/CTZLauncher/MainWindow.xaml.cs @@ -104,8 +104,9 @@ namespace CTZLauncher private void Login_Click(object sender, RoutedEventArgs e) { HttpHelper http = new HttpHelper(); - http.Send(HttpMethod.GET,"http://127.0.0.1:2000/isregistered?username=" + username.Text); - while(http.readyState!=HttpReadyState.完成){ + http.Send(HttpMethod.GET, "http://127.0.0.1:2000/isregistered?username=" + username.Text); + while (http.readyState != HttpReadyState.完成) + { DoEvent(); } String result = http.responseBody; @@ -159,7 +160,7 @@ namespace CTZLauncher private void maxmem_TextChanged(object sender, TextChangedEventArgs e) { - + //屏蔽中文输入和非法字符粘贴输入 TextBox textBox = sender as TextBox; TextChange[] change = new TextChange[e.Changes.Count];