Generating Serial Code For the Applications in Dot Net

Chikul
Posted by Chikul under ASP.NET category on | Views : 1848
It will generate Serial code of 29 characters that is 5 group of characters separated by "-" as follows :
Serial Code : OJ40J-ZICBK-2JHPI-LBPG4-U06KS


     Protected Sub btnFile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFile.Click
'Generating Serial Code For the Applications in Dot Net
Dim chars As String = "ABCDEFGHIJKLMNOPRSTUVYZX0123456789"
Dim i, j, k As Integer
Dim l As String = ""
For j = 0 To 4
For k = 0 To 4
i = CInt(Int((33 * Rnd()) + 1))
l += Mid(chars, i, 1)
Next k
l += "-"
Next j
Response.Write("Serial Code : " & Left(l, 29))
End Sub

Comments or Responses

Login to post response