You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.3 KiB

1 month ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Security.Cryptography;
using Sog;
using LitJson;
namespace HttpProxy
{
public static class MSDKApi
{
//测试,http://msdktest.qq.com
//正式 http://msdk.qq.com
public static readonly string MSDKUrl = "http://msdktest.qq.com";
public static readonly string GuestAuthUrl = "/auth/guest_check_token";
public static readonly string QQAuthUrl = "/auth/verify_login";
public static readonly string qqprofile = "/relation/qqprofile";
public static readonly string WXAuthUrl = "/auth/check_token";
public static readonly string wxprofile = "relation/wxuserinfo";
public static string CalcSig(string key, long timestamp)
{
return MD5Encrypt(key + timestamp.ToString());
}
public static string MD5Encrypt(string strText)
{
MD5 md5 = MD5.Create();
byte[] result = md5.ComputeHash(System.Text.Encoding.UTF8.GetBytes(strText));
md5.Dispose();
string byte2String = null;
for (int i = 0; i < result.Length; i++)
{
byte2String += result[i].ToString("x2");
}
return byte2String;
}
}
}