You can use random class for this purpose
Look at the code below, its a little crude, but should give you a basic idea:
string[] s = new string[] {"a","b","c","d","e","f","g","h","i" };
Random rnd = new Random();
int i = 0;
do
{
Console.WriteLine("Hit a key .....");
Console.ReadLine();
Console.WriteLine(s[rnd.Next(s.Length)]);
} while (i < s.Length);
Look at this code also, i have tried another scenario:
string s = "abcdefghi";
Random rnd = new Random();
int i = 0;
do
{
Console.WriteLine("Hit a key .....");
Console.ReadLine();
Console.WriteLine(s.Substring(rnd.Next(s.Length),1));
i++;
} while (i < s.Length);
In the first code i have taken a string[] and in the next code i have taken a single string:
[
Agent_Spock]
Basically, random class is used to get a random number between any 2 numbers as shown in the above example.
Thanks