help me to generate a string randamllyBNbalu Narani20yAsked Mar 18, 2006, 2:58 AM3.8kVisual Basic .NEThi,help to generate string data randamlly, i have for numbers, i did not got any idea for stringjust help me
BSBinu Subi20y agoPosted Mar 20, 2006, 3:02 PMWill a GUID work for you?It is easy as System.Guid.NewGuid.ToString()Cheers!
CMCraig Murphy20y agoPosted Mar 19, 2006, 5:33 PMThis will generate strings of random characters, 10 characters in length. 65 is the ASCII for A..65+26 for Z. string s = ""; int n; char c; Random r = new Random(); for (int i = 0; i < 10; i++) { n = r.Next(65, 65 + 26); c = System.Convert.ToChar(n); s = s + c; } //listBox1.Items.Add(s);
Binu SubiPosted Mar 20, 2006, 3:02 PM
It is easy as
System.Guid.NewGuid.ToString()
Cheers!
Craig MurphyPosted Mar 19, 2006, 5:33 PM
string s = ""; int n; char c; Random r = new Random(); for (int i = 0; i < 10; i++)
{
n = r.Next(65, 65 + 26);
c = System.
Convert.ToChar(n);s = s + c;
}
//listBox1.Items.Add(s);