I need to generated Random String including numbers,char,alphanumneric etc...
thanks i advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Sep 5, 2011, 9:38 AM
Mahesh ChandPosted Sep 5, 2011, 10:27 AM
No need to make text colored and size 50. I am sure Vulpes has answered you. Also, see lot of articles in the right side of this.
Thanks! Keep the forums tidy!
Bharat BhushanPosted Sep 5, 2011, 8:41 AM
http://howtouseasp.net/alpha-numeric-digits-numbers-for-password-asp-net/
Mittal SejpalPosted Sep 5, 2011, 7:07 AM
A potentially dangerous Request.Form value was detected from the client (TextBox2="HBf@gWjU#)z}m3"). after 3 or 4 times it give like this error
Prabhu RajaPosted Sep 5, 2011, 2:45 AM
http://www.obviex.com/Samples/Password.aspx
VulpesPosted Sep 3, 2011, 6:55 AM
The random string may contain any character in the ASCII range from 32 (space) to 126 (tilde) inclusive:
Satyapriya NayakPosted Sep 3, 2011, 2:47 AM
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private string RandomString(int StrLength)
{
string CharsList = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ?><*";
char[] chars = CharsList.ToCharArray();
RNGCryptoServiceProvider cryptoGen = new RNGCryptoServiceProvider();
byte[] ByteData = new byte[StrLength];
cryptoGen.GetBytes(ByteData);
StringBuilder ResultStr = new StringBuilder();
foreach (byte byt in ByteData)
{
ResultStr.Append(chars[byt % chars.Length]);
}
return ResultStr.ToString();
}
private void button1_Click(object sender, EventArgs e)
{
label1.Text = RandomString(8);
}
}
}
Thanks
If this post helps you mark it as answer