.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Code Snippets >> ASP.NET Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Generating Serial Code For the Applications in Dot Net

Posted By:Prasanti Prusty       Posted Date: January 25, 2010    Points: 10    Category: ASP.NET Controls    URL: http://www.dotnetspark.com  

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


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend