protected virtual ServerLicense CreateLicense(Type type, string key)
{
char[] chArray1 = new char[1] { ':' } ;
string[] textArray1 = key.Split(chArray1);
return new URTrackerLicense(type, key, long.Parse(textArray1[1], CultureInfo.InvariantCulture), long.Parse(textArray1[2], CultureInfo.InvariantCulture), textArray1[3], long.Parse(textArray1[4], CultureInfo.InvariantCulture), long.Parse(textArray1[5], CultureInfo.InvariantCulture), textArray1[6]);
}
哇!就是新建license,URTrackerLicense后面有几个参数,什么也看不出,感觉是要用":"split开一个字符串。来,打开URTrackerLicense构造函数看看。
public URTrackerLicense(Type type, string key, long startTicks, long ticks, string username, long userIndex, long clientCount, string mac) : base(type, key)
{
this._foundMac = false;
this._ticks = ticks;
this._startTicks = startTicks;
this._username = username;
this._userIndex = userIndex;
this._clientCount = clientCount;
this._mac = mac;
this._macArray = URTrackerLicense.GetMacArray();
this._foundMac = this._macArray.IndexOf(this._mac) > -1;
}
哦,看到ticks,startTicks,username,userIndex,clientCount,mac
难道这些就是所需参数"到期时间,使用开始时间,用户名,用户名索引,用户数,本机网卡地址"
有点意思了。呵呵。
找到了 URTrackerLicense 类,你就会知道我们猜测的没有错了。
public class URTrackerLicense : ServerLicense
{
// Methods
public URTrackerLicense(Type type, string key, long startTicks, long ticks, string username, long userIndex, long clientCount, string mac);
public static ArrayList GetMacArray();
// Properties
public long ClientCount { get; }
public bool IsExpired { get; }
public string Mac { get; }
public long StartTicks { get; }
public long Ticks { get; }
public long UserIndex { get; }
public string Username { get; }