using App.Util;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Security.Cryptography;
namespace App.Net
{
public class HttpManage : Singleton<HttpManage>
{
private HttpClient httpClient;
public void Init()
{
//AutomaticDecompression = DecompressionMethods.GZip TODO 压缩
var handle = new HttpClientHandler() { };
httpClient = new HttpClient(handle);
}
public void PostAsyn(string protocol, string stream, string sign, StringDelegate callBack)
{
var content = new FormUrlEncodedContent(new Dictionary<string, string>()
{
{"protocol",protocol },
{"steam",stream },
{"sign",sign }
});
}
public string MD5ForPHP(string stringToHash)
{
MD5 md5 = new MD5CryptoServiceProvider();
byte[] output = md5.computehash(encoding.utf8.getbytes(stringtohash));
return BitConverter.ToString(output).Replace("-", "");
}
}
}
似乎是mscorlib.dll库的问题,有点懵
嗯,解决办法最后是在Xamarin工程中扩展了一个MD5和原生一样的类。。。。
我的跟你不一样,我把自己建立的命名空间给写成了MD5,跟那个System.Security.Cryptography空间下的MD5重名了,我把自建的那个改成_MD5就可以使用了