954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Vb.net Textbox Question

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

lolsn0r
Newbie Poster
8 posts since Jun 2011
Reputation Points: 8
Solved Threads: 0
 

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,

hericles
Practically a Posting Shark
823 posts since Nov 2007
Reputation Points: 136
Solved Threads: 167
 

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

lolsn0r
Newbie Poster
8 posts since Jun 2011
Reputation Points: 8
Solved Threads: 0
 

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

hericles
Practically a Posting Shark
823 posts since Nov 2007
Reputation Points: 136
Solved Threads: 167
 

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

marsky
Newbie Poster
3 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

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

marsky
Newbie Poster
3 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You