.Net KeyGen "Hardware ID is too long" exception, is it a bug ?
Posted: Wed May 15, 2019 6:56 pm
public String HardwareID
{
get { return strHardwareID; }
set
{
if (value != null)
{
byte[] b = Convert.FromBase64String(value);
if (b.Length == 0) throw new ArgumentException("Hardware ID has zero length, use 'null' instead");
if (b.Length > 32) throw new ArgumentException("Hardware ID is too long");
if (b.Length % 4 != 0) throw new ArgumentException("Hardware ID has invalid length");
}
strHardwareID = value;
}
}
{
get { return strHardwareID; }
set
{
if (value != null)
{
byte[] b = Convert.FromBase64String(value);
if (b.Length == 0) throw new ArgumentException("Hardware ID has zero length, use 'null' instead");
if (b.Length > 32) throw new ArgumentException("Hardware ID is too long");
if (b.Length % 4 != 0) throw new ArgumentException("Hardware ID has invalid length");
}
strHardwareID = value;
}
}