VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Simple Code Generator

by Buddhika Fernando (9 Submissions)
Category: Encryption
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sun 12th June 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Simple Code Generator

API Declarations



Rem Developed By Mr P.B.C.G.Fernando
Rem System Name Code Generator
Rem For Comments [email protected] / [email protected]

Rem Software Developer In Vanik Information Technologies Sri Lanka
Rem 07147810847 , 0112524596

Rem Simple And Powerful Application


Rate Simple Code Generator




    Dim I               As Integer
    Dim Code_Val        As Byte
    
    Dim Code_1          As String
    Dim Code_2          As String
    Dim Code_3          As String
    
    Dim Code_Len        As Byte
    Dim MArray(4)       As Byte
    
    ' ------------------------------------
        Code_1 = "": Code_2 = "": Code_3 = ""
    
        Text1(0).Text = ""
        Text1(1).Text = ""
        Text1(2).Text = ""
    
        Code_Val = 0
    ' ------------------------------------

First_:
    Code_Len = 0
    For I = 1 To 6
        If Code_Len = 6 Then Exit For
Code_Err:
        Code_Val = CInt(Rnd() * 9)
        DoEvents
        If Code_Val < 5 Then
            GoTo Code_Err
        Else
            Code_Len = Code_Len + 1
            Code_1 = Code_1 & Code_Val
        End If
        
    Next I

Second_:
    Code_Len = 0
    For I = 65 To 90
        If Code_Len = 4 Then Exit For
Code_Err2:
        Code_Val = CInt(Rnd() * 90)
        DoEvents
        If Code_Val < 65 Or Code_Val > 90 Then GoTo Code_Err2
        If (Code_Val Mod 2) = 0 Then
            Code_Len = Code_Len + 1
            MArray(Code_Len) = Code_Val
            Code_2 = Code_2 & Chr(Code_Val)
        Else
            GoTo Code_Err2
        End If
    Next I
    
    If (CDbl(Code_1) Mod 2) = 1 Then
        DoEvents
        Code_1 = ""
        GoTo First_
    Else
        Text1(0).Text = Code_1
    End If
    
    If ((Val(MArray(1)) + Val(MArray(2)) + Val(MArray(3)) + Val(MArray(4))) Mod 2) = 0 Then
        Text1(1).Text = Code_2
    Else
        DoEvents
        I = 0
        For I = 1 To 4
            MArray(I) = 0
        Next I
        GoTo Second_
    End If
    
    Text1(2).Text = Left(Code_1, 2) & _
                    Right(Code_2, 2) & _
                    CInt(Rnd() * 9) & _
                    CInt(Rnd() * 5)

End Sub

Download this snippet    Add to My Saved Code

Simple Code Generator Comments

No comments have been posted about Simple Code Generator. Why not be the first to post a comment about Simple Code Generator.

Post your comment

Subject:
Message:
0/1000 characters