My problem now is trying to generate a random number, assign it to an array, then generate a new number, check it's not the same as the previous, or any other previous generated numbers, and if it isnt, assign it to the next array number, otherwise generate a new one.

ie. -

generate random number 1
assign to array [1]
generate random number 2
check random number 2 is not the same as array[any previous number done]
if same, regenerate and check again
if not same, assign to array[next value]

here is my code right now:

Code:
public void createMap()
{
Random rnd = new Random();
Random rnd2 = new Random();
Random rnd3 = new Random();
Random rnd4 = new Random();
Random rnd5 = new Random();
Random rnd6 = new Random();
string abctext = "";
int abcde = 0;
int dgfh = 0;
for(int uvw = 0; uvw <= 24;uvw++)
{
for(int xyz = 0; xyz <= 35;xyz++)
{
int lmn = rnd.Next(3);
if(lmn == 0 )
{
if(dgfh < 600)
{
if(xyz == 0 && uvw == 0)
{
maplocation[uvw,xyz,0] = rnd2.Next(100,599);

}
else
{
if(uvw == 0 && xyz >= 1)
{
for(int rst = 0; rst <= xyz-1;rst++)
{
while(maplocation[uvw,xyz,0] == maplocation[uvw,rst,0] && dgfh <= 600)
{
int randsysnum2 = new int();
randsysnum2 = rnd3.Next(100,599);
maplocation[uvw,xyz,0] = randsysnum2;
}
}
}
else
{
if(uvw >= 1 && xyz == 0)
{
for(int opq = 0; opq <= uvw-1;opq++)
{
while(maplocation[uvw,xyz,0] == maplocation[opq,xyz,0] && dgfh <= 600)
{
int randsysnum3 = new int();
randsysnum3 = rnd4.Next(100,599);
maplocation[uvw,xyz,0] = randsysnum3;
}
}
}
else
{
for(int opq = 0; opq <= uvw-1;opq++)
{
for(int rst = 0; rst <= xyz-1;rst++)
{
while(maplocation[uvw,xyz,0] == maplocation[opq,rst,0] && dgfh <= 600)
{
int randsysnum4 = new int();
randsysnum4 = rnd6.Next(100,599);
maplocation[uvw,xyz,0] = randsysnum4;
}
}
}
}
}
}
}
}
else
{
maplocation[uvw,xyz,0] = 0;
}
dgfh++;
myArray[abcde] = Convert.ToString(maplocation[uvw,xyz,0]);
abcde++;
}

}
Array.Sort(myArray);
FileInfo fi = new FileInfo("test.txt");
fi.Delete();
StreamWriter w = File.AppendText("test.txt");
for(int abcdef = 0; abcdef <= abcde-1; abcdef++)
{
abctext = abcdef+1 +" " +myArray[abcdef];
Log (abctext, w);
}
w.Close();

}
Any ideas?