Hi everyone

I have a question to everyone.

dim a as string ="preview="
dim b as string = "&amp"

textbox1.text = a + "Random Code" + b

result must be: preview=93a92&amp

Random Code: I Need something that does not skip the text/number.
Random Code can be everything.
Example: 93a92,b3at2, 1256abcde or something ;)
If anyone can help me let me know

Thanks in advance

7 Years
Discussion Span
Last Post by marsky

Here is an old function I used to create a random text string.

Random rand = new Random();
        string pw = "";
        Char[] chars = new Char[6];
        int count = 0;
        while (count < 6)
            chars[count] = (Char)rand.Next(97, 123);
            pw += chars[count];

The rand.Next(97, 123) creates a number between 97 and 123 and converts that into a lowercase letter. The digits are numbers (0-9)are 48 - 57 so if you want numbers and letters you might need to add another random function that decides whether to calculate a number or a letter.

Hope that helps,

Votes + Comments
nothing personal, I just preffer seeing vb.net code in a vb.net forum.

im trying to program a computerized examination thru vb.net..any idea guys...hope you can help me guys thank you


hi guys....i have a question, how to program a computerized examination using vb.net?i hope you can help me guys...i really need it for my requirement of my project...thank you^_^

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.