How to Generates 10 digit Random Numbers in C#?

Rajnilari2015
Posted by Rajnilari2015 under C# category on | Points: 40 | Views : 11540
The below code will do this

using System;
using System.Linq;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
var str = GetTenDigitRandomNumbers();
}

public static string GetTenDigitRandomNumbers()
{
Random generator = new Random();
return generator.Next(0, 1000000).ToString("D10");
}
}
}

Comments or Responses

Login to post response