我正在使用 Brett 给出的这个例子:
这样做:
public static bool VerifyLicenseKey(string applicationGuid)
{
Console.WriteLine("G: " + applicationGuid);
var appSettings = AppSettings.GetInstance();
if (appSettings == null)
{
return false;
}
var hwinfo = HardwareInfo.GetHardwareSerial();
Console.WriteLine("h: " + hwinfo);
Console.WriteLine("a: " + applicationGuid);
var currentSerial = Crypto.EncryptStringAES(hwinfo, applicationGuid);
Console.WriteLine("c: " + currentSerial);
Console.WriteLine("o: " + appSettings.LicenseSerialNumber);
if (currentSerial == appSettings.LicenseSerialNumber)
{
return true;
}
return false;
}
}
和每次都回来一样,但当我打电话给GetHardwareSerial
它时,它不是。applicationGuid
EncryptStringAES
我使用了错误的课程吗?不应该每次都一样吗?
如果没有,是否有人有一个更好的例子,其中加密的值是相同的?