强子新街口

This commit is contained in:
“wanyongkang”
2021-02-08 16:29:25 +08:00
parent 69ad494843
commit 05f5e189e0
3 changed files with 650 additions and 0 deletions

View File

@@ -65,6 +65,27 @@ namespace Hncore.Pass.Vpn.Service
}
return client;
}
public virtual string MD5(string password) {
byte[] textBytes = System.Text.Encoding.Default.GetBytes(password);
try {
System.Security.Cryptography.MD5CryptoServiceProvider cryptHandler;
cryptHandler = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] hash = cryptHandler.ComputeHash (textBytes);
string ret = "";
foreach (byte a in hash) {
if (a<16)
ret += "0" + a.ToString ("x");
else
ret += a.ToString ("x");
}
return ret ;
}
catch {
throw;
}
}
protected virtual void AddCookie(HttpClient client, string cookie)
{
client.DefaultRequestHeaders.Remove("Cookie");