ilcorsaronero
.
it
HOME
GUIDE
TORRENT
Programmazione
Articoli ASP.NET
Articoli C#
Articoli HTML 5
Articoli Vari
Guida HTML
Guida CSS
UTILITA'
Entità Carattere (ISO)
Guida estensioni dei file
Convertitore File
Convertire .Pdf in Word
ConnectionStrings
Link Angular
Guide Angular
Angular In Dept
Link Ajax
jesty.wordpress.com
www.dhtmlgoodies.com
www.dynamicdrive.com
miniajax.com
ajaxian.com
dojotoolkit.org
snipplr.com
www.webappers.com
www.ajaxprojects.com
www.openjs.com
C#
-
Generatore di lettere Random
24/02/2011 22:23:15
using System;
static class RandomLetter
{
static Random _random = new Random();
public static char GetLetter()
{
// This method returns a random lowercase letter.
// ... Between 'a' and 'z' inclusize.
int num = _random.Next(0, 26); // Zero to 25
char let = (char)('a' + num);
return let;
}
}
class Program
{
static void Main()
{
// Get random lowercase letters.
Console.WriteLine(RandomLetter.GetLetter());
Console.WriteLine(RandomLetter.GetLetter());
Console.WriteLine(RandomLetter.GetLetter());
Console.WriteLine(RandomLetter.GetLetter());
Console.WriteLine(RandomLetter.GetLetter());
}
}
--- Output of the program ---
i
q
f
t
o
1
2
3
4
5
Copyright (c) 2010 ilcorsaronero. All rights reserved.