Sign in
Google apps
Main menu
Post a Comment On:
Blogpad
"Create a random number"
No comments yet. -
1 – 0 of 0
This will create a 10-digits random number
public static string CreateRandomNumber()
{
return GenerateRandomPhoneNumber(3);
}
private static string GenerateRandomPhoneNumber(int seed)
{
string phoneNumber = String.Empty;
Random random = new Random((int)(DateTime.Now.Ticks % 5000000000 + seed));
phoneNumber += random.Next(1, 10).ToString();
for (int i = 0; i < 9; i++)
{
phoneNumber += random.Next(0, 10).ToString();
}
return phoneNumber;
}
posted by fc at
7:08 PM
on Jun 23, 2010
Leave your comment
You can use some HTML tags, such as
<b>, <i>, <a>
This blog does not allow anonymous comments.
Google Account
You will be asked to sign in after submitting your comment.
Please prove you're not a robot
"Create a random number"
No comments yet. -