|
-
Reef Shark
Dynamic dimensioning (VB.net)
I need some help on an encryption program I am writing.
I am just learning vb.net so bear with me...(i already know C++)
I have an small encryption program im writing, you type your password in a feild, click 'encrypt' and it runs your password through a algorithm im writing. Heres my code to capture the password lenght, (and the password) and display them (to prove im doing it right). I declared password, and passlength before this(globally)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
password = TextBox1.Text
TextBox3.Text = password
passlength = Len(password)
TextBox4.Text = passlength
End Sub
I need to figure out how to dimension variables based on 'passlength'
i dont know if you can do anything like this...but I was thinking a loop that would do something like this:
dim looplength as integer
looplength = 0
do while looplength <= passlength
dim var(looplength) as char
looplength = looplength + 1
loop
and the line:
dim var(looplength) as char
dim's a char named var(and then this is whatever looplenght =) so that it would start with:
var1 as char
then when looplength = 2
var2 as char
then when looplenght = 3
var3 as char
do you understand what i mean? I need to figure out how to do this.
-stasis
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|