Adsence750x90

Monday, May 5, 2008

ASP.NET Code Snippet: Generating Random Number with Random String in C# ASP.NET

ASP.NET C# Code Snippet: Generating Random Number with String in C# ASP.NET

public string RandomStringKeys()
{
string returnString = string.Empty;
string Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
string numbers = "0123456789";
char[] letterArray = Letters.ToCharArray();
char[] numberArray = numbers.ToCharArray();
Random objrandomNumber = new Random();
byte[] selection = Encoding.ASCII.GetBytes(objrandomNumber.Next(111111, 999999).ToString());
BitArray bArray = new BitArray(selection);

string binaryString = string.Empty;
int t = 0;
int f = 0;

for (int i = 0; i < encodestring =" binaryString.Substring(objrandomNumber.Next(1," i =" 0;">

No comments: