here we are using GUID for generate serial numbers and GUID is always unique.
Example format: XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX.
Example format: XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX.
Guid SerialKeyGuid = Guid.NewGuid(); string AccessKey = SerialKeyGuid.ToString("N"); string AccessKeyLength = AccessKey.Substring(0, 28).ToUpper(); char[] serialArray = AccessKeyLength.ToCharArray(); string SerialNumber = ""; int P = 0; for (int B = 0; B < 28; B++) { for (P = B; P < 4 + B; P++) { SerialNumber += serialArray[P]; } if (P == 28) { break; } else { B = (P) - 1; SerialNumber += "-"; } }
Comments
Post a Comment