强子新街口
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user