{
String[] strLabel = {
"First Label",
"Second Label",
"Third Label",
"Fourth Label"
};
Random r = new Random();
int iSelect = r.Next(0, 3);
lblRandom.Text = strLabel[iSelect];
}
button1 = new Button
{
String[] button = {
command one();,
command two();,
command three();,
command four();"
};
Random r = new Random();
int iSelect = r.Next(0, 3);
button1_click = button[iSelect];
}
public string GenRandomString(int length, char[] charset)
{
List<char> str = new List<char>();
for (int x = 0; x < length; x++)
str.Add(charset[new Random().Next(charset.Length - 1)]);
return new String(str.ToArray());
}
public string GenRandomString(int length, char[] charset)
{
List<char> str = new List<char>();
for (int x = 0; x < length; x++)
str.Add(charset[new Random().Next(charset.Length - 1)]);
return new String(str.ToArray());
}
labelWhatever.Text = GenRandomString(10, "abcdefghijklmnopqrstuvwxyz1234567890".ToCharArray());
Copyright © 2024, NextGenUpdate.
All Rights Reserved.