Generate Random Code In C#
private void generate()
{
var chars = "0123456789";
var stringChars = new char[6];
var random = new Random();
for (int i = 0; i < stringChars.Length; i++)
{
stringChars[i] = chars[random.Next(chars.Length)];
}
var finalString = new String(stringChars);
ab = finalString.ToString();
// lblOutlet_Code.Text = finalString.ToString();
}
Next
« Prev Post
« Prev Post
Previous
Next Post »
Next Post »
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Introduction : Here I will explain how to read or get connectionstring from app.config file in c# . By using System.Configuration refere...
-
how to create your own Gridview with scrollbars to scroll through the records. <div style="border-style: solid solid solid solid; bo...
-
Html Code........... <div Id="print"> // Contain U Want to Print....... </div> <input id="Button1...
-
C# Code using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.L...