Generate 16 Digit Unique Number in CSharp
Now i am going ot discuss about how to Generate 16 digit Unique number
So ,
5 digit Random using System.Random Class
5 digit number by using TimeSpan
6 numbers by System Time (HH:MM:SS)
This is the Code
System.Random fiveRandom = new Random();
TimeSpan tsFive = new TimeSpan();
tsFive = DateTime .Now.Subtract (Convert.ToDateTime ("01/01/1900"));
string rad = fiveRandom.Next(10000, 99999) + tsFive.Days.ToString() + System.DateTime.Now.Hour.ToString ("00") + System.DateTime.Now.Minute.ToString ("00") + System.DateTime.Now.Second.ToString ("00") ;
Read more »