/// <summary> /// Attempts to validate a user's login information. /// </summary> /// <param name="username">The username to log in with.</param> /// <param name="password">The password (in plain-text) to log in with.</param> /// <returns>The server's response. Use the response's Successful property to determine if the information is valid.</returns> public static SignInResponse AttemptSignIn(string username, string password) { var request = new SignInRequest { Username = username, PasswordMd5 = Md5Crypto.ComputeHashToString(password).ToLower() }; return(AssemblyServer.SendRequest <SignInRequest, SignInResponse>(request)); }
private static string GetSig(Dictionary <string, string> formData) { var sig = ""; foreach (var key in formData.Keys) { sig += $"{key}={formData[key]}"; } sig = Md5Crypto.HashCalculate(sig + "62f8ce9f74b12f84c123cc23437a4a32"); return(sig); }
/// <summary> /// 16位MD5加密 /// </summary> /// <param name="str"></param> /// <returns></returns> public static string Encode16MD5(this String str) { return(Md5Crypto.Encode16MD5(str)); }