代码拉取完成,页面将自动刷新
using System;
using System.Collections;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
namespace API{
static class Endpoint{
// private static string Regoin = "http://192.168.10.63:8087";
private static string Regoin = "http://v2.api.juliangip.com";
internal enum url : byte{
[Description("/users/getbalance")]
USERS_GETBALANCE,
[Description("/users/getAllOrders")]
USERS_GETALLORDERS,
[Description("/users/getCity")]
USERS_GETCITY,
[Description("/dynamic/getips")]
DYNAMIC_GETIPS,
[Description("/dynamic/check")]
DYNAMIC_CHECK,
[Description("/dynamic/setwhiteip")]
DYNAMIC_SETWHITEIP,
[Description("/dynamic/getwhiteip")]
DYNAMIC_GETWHITEIP,
[Description("/dynamic/replaceWhiteIp")]
DYNAMIC_REPLACEWHITEIP,
[Description("/dynamic/remain")]
DYNAMIC_REMAIN,
[Description("/dynamic/balance")]
DYNAMIC_BALANCE,
[Description("/alone/getips")]
ALONE_GETIPS,
[Description("/alone/setwhiteip")]
ALONE_SETWHITEIP,
[Description("/alone/getwhiteip")]
ALONE_GETWHITEIP,
[Description("/alone/replaceWhiteIp")]
ALONE_REPLACEWHITEIP,
[Description("/unlimited/getips")]
UNLIMITED_GETIPS,
[Description("/unlimited/setwhiteip")]
UNLIMITED_SETWHITEIP,
[Description("/unlimited/getwhiteip")]
UNLIMITED_GETWHITEIP,
[Description("/unlimited/replaceWhiteIp")]
UNLIMITED_REPLACEWHITEIP,
[Description("/postpay/getips")]
POSTPAY_GETIPS,
[Description("/postpay/check")]
POSTPAY_CHECK,
[Description("/postpay/setwhiteip")]
POSTPAY_SETWHITEIP,
[Description("/postpay/getwhiteip")]
POSTPAY_GETWHITEIP,
[Description("/postpay/replaceWhiteIp")]
POSTPAY_REPLACEWHITEIP,
[Description("/company/postpay/getips")]
COMPANY_POSTPAY_GETIPS,
[Description("/company/postpay/setwhiteip")]
COMPANY_POSTPAY_SETWHITEIP,
[Description("/company/postpay/getwhiteip")]
COMPANY_POSTPAY_GETWHITEIP,
[Description("/company/postpay/delwhiteip")]
COMPANY_POSTPAY_DELWHITEIP,
}
public static string GetDescription(this Enum enumValue)
{
FieldInfo fieldInfo = enumValue.GetType().GetField(enumValue.ToString());
DescriptionAttribute[] attrs =
fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), false) as DescriptionAttribute[];
return attrs.Length > 0 ? Regoin+attrs[0].Description : Regoin+enumValue.ToString();
}
public static string GetParams<TK,TV>(Dictionary<TK,TV> dic)
{
string str = "";
string key = "";
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
//先对参数字典进行排序
dic = dic.OrderBy(i => i.Key).ToDictionary(i =>i.Key,i =>i.Value);
foreach(var obj in dic){
Console.WriteLine($"{obj.Key.ToString()}:{obj.Value.ToString()}");
if(obj.Key != null && String.Equals(obj.Key,"key")){
key = obj.Value+"";
continue;
}
if(obj.Value == null || (obj.Value+"").Trim() == ""){
continue;
}
str += obj.Key+"="+obj.Value+"&";
}
byte[] buffer = Encoding.Default.GetBytes(str+$"key={key}");
byte[] somme = md5.ComputeHash(buffer);
string sign = "";
foreach(byte s in somme){
sign += s.ToString("x2");
}
str += $"sign={sign}";
return str;
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。