C#.Net – Fast Random String Generation

Just a quick post I today found a neat little hack that allowed me to generate a random string within my C# projects.

Basically all you need to do is the following:

string randomStr = (Path.GetRandomFileName()).key.Replace(".", "");

and if you have defined

using System.IO;

at the top, you should now have a random string.

Thanks Matt

A budding Web Developer and Tech Geek