string strURL = "http://localhost:6884/Mwinform/account/AccountLoginCheck.aspx?Account=" + Account + "&&Password=" + Password + "&&GameID=" + GameID +"&&lan="+lan+"";//创建一个地址
System.Net.HttpWebRequest request;
try
{
request = (System.Net.HttpWebRequest)WebRequest.Create(strURL);//创建一个HTTP请求
request.Method = "get";//发送请求
System.Net.HttpWebResponse response;
response = (System.Net.HttpWebResponse)request.GetResponse();//获取响应
StreamReader sr = new StreamReader(response.GetResponseStream());
string jsonstr = sr.ReadToEnd();//返回响应
JSONConvert json = new JSONConvert();
JSONObject jsonobj = json.DeserializeObject(jsonstr);//将字符串转换为JSON
string mesage = jsonobj["message"].ToString().Replace("+", " ").Replace("%2c", ",");
if (mesage.Contains("Login Successfully.") || mesage.Contains("登錄成功"))
{
AddAccountToTxt add = new AddAccountToTxt();
string url = "operation.xml";
add.AddLog(Account, url, Password);
mesage = "Current Account:" + Account + ".Please keep in mind that you account and password";
}
MessageBox.Show(mesage);
sr.Close();
System.Net.HttpWebRequest request;
try
{
request = (System.Net.HttpWebRequest)WebRequest.Create(strURL);//创建一个HTTP请求
request.Method = "get";//发送请求
System.Net.HttpWebResponse response;
response = (System.Net.HttpWebResponse)request.GetResponse();//获取响应
StreamReader sr = new StreamReader(response.GetResponseStream());
string jsonstr = sr.ReadToEnd();//返回响应
JSONConvert json = new JSONConvert();
JSONObject jsonobj = json.DeserializeObject(jsonstr);//将字符串转换为JSON
string mesage = jsonobj["message"].ToString().Replace("+", " ").Replace("%2c", ",");
if (mesage.Contains("Login Successfully.") || mesage.Contains("登錄成功"))
{
AddAccountToTxt add = new AddAccountToTxt();
string url = "operation.xml";
add.AddLog(Account, url, Password);
mesage = "Current Account:" + Account + ".Please keep in mind that you account and password";
}
MessageBox.Show(mesage);
sr.Close();