public static async Task <string> editNecessaryInfo(string nickName, string profession = "", string organization = "") { if (HttpPostUntil.isInternetAvailable) { try { var postdata = HttpPostUntil.GetBasicPostData(); postdata.Add(new KeyValuePair <string, string>("nickName", nickName)); postdata.Add(new KeyValuePair <string, string>("profession", profession)); postdata.Add(new KeyValuePair <string, string>("organization", organization)); var json = await HttpPostUntil.HttpPost(Data.Urls.user.editNecessaryInfo, new HttpFormUrlEncodedContent(postdata)); if (json.Contains("studentId")) { return("Success"); } else { return(null); } } catch (Exception) { return(null); } } else { return(null); } }
public static async Task <string> CheckResetPasswordCaptcha(string m, string captcha) { if (HttpPostUntil.isInternetAvailable) { try { var postdata = HttpPostUntil.GetBasicPostData(); postdata.Add(new KeyValuePair <string, string>("m", m)); postdata.Add(new KeyValuePair <string, string>("captcha", captcha)); postdata.Add(new KeyValuePair <string, string>("areaCode", "null")); var json = await HttpPostUntil.HttpPost(Data.Urls.user.checkResetPasswordCaptcha, new HttpFormUrlEncodedContent(postdata), false); var obj = JsonObject.Parse(json).GetNamedObject("data"); if (obj.GetNamedNumber("statusInt") != 1) { return(obj.GetNamedString("errorStr")); } else { return(null); } } catch (Exception) { return("网络异常"); } } else { return("网络异常"); } }
public static async Task <string> register(string user, string pwd, string captcha, string academyId, string grade, string schoolId) { if (HttpPostUntil.isInternetAvailable) { try { var postdata = HttpPostUntil.GetBasicPostData(); FridayCloudService.ServiceClient sc = new FridayCloudService.ServiceClient(FridayCloudService.ServiceClient.EndpointConfiguration.BasicHttpBinding_IService); var p = await sc.EncryptDataAsync(pwd); var mm = await sc.EncryptDataByKeyAsync(user, user); await sc.CloseAsync(); postdata.Add(new KeyValuePair <string, string>("account", mm)); postdata.Add(new KeyValuePair <string, string>("password", p)); postdata.Add(new KeyValuePair <string, string>("areaCode", "null")); postdata.Add(new KeyValuePair <string, string>("identityStatus", "0")); postdata.Add(new KeyValuePair <string, string>("deviceCode", HttpPostUntil.NowTime)); var json = await HttpPostUntil.HttpPost(Data.Urls.user.Register.register, new HttpFormUrlEncodedContent(postdata), false); var obj = JsonObject.Parse(json).GetNamedObject("data"); if (obj.GetNamedNumber("statusInt") != 1) { return(obj.GetNamedString("errorStr")); } else { return(null); } } catch (Exception) { return("网络异常"); } } else { return("网络异常"); } }
public static async Task <string> getRegisterCaptcha(string m, string pwd) { if (HttpPostUntil.isInternetAvailable) { try { var postdata = HttpPostUntil.GetBasicPostData(); FridayCloudService.ServiceClient sc = new FridayCloudService.ServiceClient(FridayCloudService.ServiceClient.EndpointConfiguration.BasicHttpBinding_IService); var p = await sc.EncryptDataAsync(pwd); var mm = await sc.EncryptDataByKeyAsync(m, m); await sc.CloseAsync(); postdata.Add(new KeyValuePair <string, string>("m", m)); postdata.Add(new KeyValuePair <string, string>("p", p)); postdata.Add(new KeyValuePair <string, string>("areaCode", "null")); postdata.Add(new KeyValuePair <string, string>("mm", mm)); var json = await HttpPostUntil.HttpPost(Data.Urls.user.Register.getRegisterCaptcha, new HttpFormUrlEncodedContent(postdata), false); var obj = JsonObject.Parse(json).GetNamedObject("data"); if (obj.GetNamedNumber("statusInt") != 1) { return(obj.GetNamedString("errorStr")); } else { return(null); } } catch (Exception) { return("网络异常"); } } else { return("网络异常"); } }