public bool CheckAccountExchange(String username, String token) { WebClient client = new WebClient(); /* GetSelectByName_HttpGet */ client.Headers[HttpRequestHeader.ContentType] = "application/json"; client.Headers.Add(HttpRequestHeader.AcceptCharset, "utf-8"); client.Encoding = Encoding.UTF8; String response = client.DownloadString(new Uri(URL + "api.php/CheckAccountExchange?username="******"&token=" + token)); FileRead1 file = JsonConvert.DeserializeObject <FileRead1>(response); return(file.SUCCESS); }
public bool ChangePassAccount(String username, String oldpass, String newpass) { WebClient client = new WebClient(); /* GetSelectByName_HttpGet */ client.Headers[HttpRequestHeader.ContentType] = "application/json"; client.Headers.Add(HttpRequestHeader.AcceptCharset, "utf-8"); client.Encoding = Encoding.UTF8; String response = client.DownloadString(new Uri(URL + "api.php/ChangePassAccount?username="******"&oldpass="******"&newpass=" + newpass)); FileRead1 file = JsonConvert.DeserializeObject <FileRead1>(response); MessageBox.Show(file.DATA); return(file.SUCCESS); }
public bool TransferAccountExchange(String username1, String token, String username2, String amount) { WebClient client = new WebClient(); /* GetSelectByName_HttpGet */ client.Headers[HttpRequestHeader.ContentType] = "application/json"; client.Headers.Add(HttpRequestHeader.AcceptCharset, "utf-8"); client.Encoding = Encoding.UTF8; String response = client.DownloadString(new Uri(URL + "api.php/TransferAccountExchange?username1=" + username1 + "&token=" + token + "&username2=" + username2 + "&amount=" + amount)); FileRead1 file = JsonConvert.DeserializeObject <FileRead1>(response); MessageBox.Show(file.DATA); return(file.SUCCESS); }
public String LoginAccount(String username, String password) { String token = ""; WebClient client = new WebClient(); /* GetSelectByName_HttpGet */ client.Headers[HttpRequestHeader.ContentType] = "application/json"; client.Headers.Add(HttpRequestHeader.AcceptCharset, "utf-8"); client.Encoding = Encoding.UTF8; String response = client.DownloadString(new Uri(URL + "api.php/LoginAccount?username="******"&password=" + password)); FileRead1 file = JsonConvert.DeserializeObject <FileRead1>(response); if (file.SUCCESS) { return(file.DATA); } else { MessageBox.Show(file.DATA); return(token); } }