重构代码
重构代码
This commit is contained in:
@@ -14,7 +14,9 @@ namespace Yi.Framework.Common.Helper
|
||||
{
|
||||
public static string HttpGet(string Url, string postDataStr="")
|
||||
{
|
||||
#pragma warning disable SYSLIB0014 // 类型或成员已过时
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url + (postDataStr == "" ? "" : "?") + postDataStr);
|
||||
#pragma warning restore SYSLIB0014 // 类型或成员已过时
|
||||
request.Method = "GET";
|
||||
request.ContentType = "text/html;charset=UTF-8";
|
||||
|
||||
@@ -52,7 +54,9 @@ namespace Yi.Framework.Common.Helper
|
||||
public static string HttpPost(string Url, string postDataStr="")
|
||||
{
|
||||
CookieContainer cookie = new CookieContainer();
|
||||
#pragma warning disable SYSLIB0014 // 类型或成员已过时
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url);
|
||||
#pragma warning restore SYSLIB0014 // 类型或成员已过时
|
||||
request.Method = "POST";
|
||||
request.ContentType = "application/x-www-form-urlencoded";
|
||||
request.ContentLength = Encoding.UTF8.GetByteCount(postDataStr);
|
||||
|
||||
@@ -13,7 +13,9 @@ namespace Yi.Framework.Common.Helper
|
||||
/// <returns></returns>
|
||||
public static string MD5Encrypt16(string password)
|
||||
{
|
||||
#pragma warning disable SYSLIB0021 // 类型或成员已过时
|
||||
var md5 = new MD5CryptoServiceProvider();
|
||||
#pragma warning restore SYSLIB0021 // 类型或成员已过时
|
||||
string t2 = BitConverter.ToString(md5.ComputeHash(Encoding.Default.GetBytes(password)), 4, 8);
|
||||
t2 = t2.Replace("-", string.Empty);
|
||||
return t2;
|
||||
|
||||
Reference in New Issue
Block a user