int Random(int x, int y)
{
Random random = new Random();
int randomNumber = random.Next(x, y);
return randomNumber;
}
double Random(double x, double y)
{
Random random = new Random();
double randomNumber = random.NextDouble() * (y - x) + x;
return randomNumber;
}
bool Random()
{
int x = Numbers.Random(1, 2);
return x == 1;
}
string Random(int length)
{
const string allowedChars =
"ABCDEFGHJKLMNOPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz0123456789!@$?_-";
var chars = new char[length];
var rd = new Random();
for (int i = 0; i < length; i++)
{
chars[i] = allowedChars[rd.Next(0, allowedChars.Length)];
}
return new string(chars);
}