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

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];
            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,

commented: nothing personal, I just preffer seeing vb.net code in a vb.net forum. -2

OKé I will try it out !! ;D
Thanks ;D

Wow, I use copy and paste to help a guy out and get down repped. Awesome.

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^_^

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.