Click here to Skip to main content
15,867,686 members
Home / Discussions / C#
   

C#

 
GeneralRe: Need the code for Randomization of numbers using c# Pin
OriginalGriff5-Oct-09 5:32
mveOriginalGriff5-Oct-09 5:32 
GeneralRe: Need the code for Randomization of numbers using c# Pin
vasavi.p4-Oct-09 22:11
vasavi.p4-Oct-09 22:11 
GeneralRe: Need the code for Randomization of numbers using c# Pin
Christian Graus4-Oct-09 22:13
protectorChristian Graus4-Oct-09 22:13 
GeneralRe: Need the code for Randomization of numbers using c# Pin
OriginalGriff4-Oct-09 22:14
mveOriginalGriff4-Oct-09 22:14 
JokeRe: Need the code for Randomization of numbers using c# Pin
Christian Graus4-Oct-09 22:21
protectorChristian Graus4-Oct-09 22:21 
JokeRe: Need the code for Randomization of numbers using c# Pin
OriginalGriff4-Oct-09 22:28
mveOriginalGriff4-Oct-09 22:28 
JokeRe: Need the code for Randomization of numbers using c# Pin
nagendrathecoder4-Oct-09 22:55
nagendrathecoder4-Oct-09 22:55 
GeneralRe: Need the code for Randomization of numbers using c# Pin
vasavi.p4-Oct-09 22:54
vasavi.p4-Oct-09 22:54 
hi

try with the below code

protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "";

int Quescnt = 6;

string Randomnos = string.Empty;

for (int i = 0; i < Quescnt; i++)
{
int RandomNumber = RandomClass.Next(28, 37);
if (!Randomnos.ToString().Contains(RandomNumber.ToString() + ","))
{
Randomnos = Randomnos + RandomNumber.ToString() + ", ";
}
else
{
Quescnt++;
}
}

Label1.Text = Randomnos;

}


and try with this too[this will go to infinite loop]

protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "";

int Quescnt = 6;

string Randomnos = string.Empty;

for (int i = 0; i < Quescnt; i++)
{
int RandomNumber = RandomClass.Next(28, 33);
if (!Randomnos.ToString().Contains(RandomNumber.ToString() + ","))
{
Randomnos = Randomnos + RandomNumber.ToString() + ", ";
}
else
{
Quescnt++;
}
}

Label1.Text = Randomnos;

}
GeneralRe: Need the code for Randomization of numbers using c# Pin
OriginalGriff4-Oct-09 23:01
mveOriginalGriff4-Oct-09 23:01 
AnswerRe: Need the code for Randomization of numbers using c# Pin
Richard MacCutchan4-Oct-09 23:23
mveRichard MacCutchan4-Oct-09 23:23 
GeneralRe: Need the code for Randomization of numbers using c# Pin
J4amieC4-Oct-09 23:29
J4amieC4-Oct-09 23:29 
GeneralRe: Need the code for Randomization of numbers using c# Pin
Richard MacCutchan5-Oct-09 0:45
mveRichard MacCutchan5-Oct-09 0:45 
GeneralRe: Need the code for Randomization of numbers using c# Pin
J4amieC5-Oct-09 0:59
J4amieC5-Oct-09 0:59 
GeneralRe: Need the code for Randomization of numbers using c# Pin
Richard MacCutchan5-Oct-09 6:19
mveRichard MacCutchan5-Oct-09 6:19 
GeneralRe: Need the code for Randomization of numbers using c# Pin
J4amieC4-Oct-09 23:28
J4amieC4-Oct-09 23:28 
GeneralRe: Need the code for Randomization of numbers using c# Pin
DeepakMega4-Oct-09 23:33
DeepakMega4-Oct-09 23:33 
Questionform closing reason problem Pin
Ajithevn4-Oct-09 21:30
Ajithevn4-Oct-09 21:30 
AnswerRe: form closing reason problem Pin
Christian Graus4-Oct-09 21:32
protectorChristian Graus4-Oct-09 21:32 
GeneralRe: form closing reason problem Pin
Ajithevn5-Oct-09 0:30
Ajithevn5-Oct-09 0:30 
Answer[Message Deleted] Pin
Blikkies4-Oct-09 21:50
professionalBlikkies4-Oct-09 21:50 
GeneralRe: form closing reason problem Pin
Ajithevn5-Oct-09 0:32
Ajithevn5-Oct-09 0:32 
GeneralRe: form closing reason problem Pin
Blikkies5-Oct-09 1:11
professionalBlikkies5-Oct-09 1:11 
AnswerRe: form closing reason problem Pin
Mycroft Holmes4-Oct-09 22:33
professionalMycroft Holmes4-Oct-09 22:33 
GeneralRe: form closing reason problem Pin
Ajithevn5-Oct-09 0:27
Ajithevn5-Oct-09 0:27 
Questionwhat is the problem in this &gt;&gt;&gt; see the code and pls help me Pin
amaankhan4-Oct-09 21:06
amaankhan4-Oct-09 21:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.