Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Arrays and more in VB.Net


ghost's Avatar
0 0

Ok, I have vb.net 2003 including the handbook (comes with the vb.net download). Anyways, I am working on a project that will take text you input into it, then change it to a simple encryption I have made, then takes those strings (or arrays, depending if I can do it this way) and put it into binary. What I need to to know is….

*What all can be done with an array, and an array is like a list right?

*If an array is like a list, can whatever you list be given values

*How can I take text inputed and "chop it up" so I can get the values for each letter?

*How do I get remainders to be known in math?

Any help will be appreciated!


ghost's Avatar
0 0

anyone able to help?


ghost's Avatar
0 0

bump!


bl4ckc4t's Avatar
Banned
0 0

Read up on encryption, learn the hashing function of VB.NET

Bl4ckC4t


ghost's Avatar
0 0

*If an array is like a list, can whatever you list be given values

*How can I take text inputed and "chop it up" so I can get the values for each letter?

*How do I get remainders to be known in math?

  1. An array can be indexed by using array(x), where array is the array name and x is the item's location in the array. To assign a value, just use a statement like array(x)=value, where value is the value you want to assign.

  2. If I recall right, strings can be accessed like arrays. However, for most of my "string chopping", I use nested Strings.Left and Strings.Right functions. For instance, to get the ASCII value of each character in a string, I would do something like:

Dim x as Integer Dim strText as String

strText = whatever

Dim Ascii(strText.Len) as Integer

For x = 1 to strText.Len Ascii(x) = CInt(Strings.Left(Strings.Right(strText, strText.Len-(x-1)),1)) Next

This may not be perfect, but this is the general idea, and I'm sure there's an easier way to do this… I'm just too lazy to read up on accessing a string like an array, so there's a possible solution.

  1. Finding a remainder like in math is as simple as using the Mod operator. If I recall right, you need to import System.Math to use it, but Mod will return the remainder from dividing by the number after Mod (e.g., 14 Mod 3 = 2).

Hope that helps some.