Click here to Skip to main content
15,914,413 members
Home / Discussions / C#
   

C#

 
GeneralRe: Get name of system folder [using C#] Pin
DaveAuld6-May-11 21:00
professionalDaveAuld6-May-11 21:00 
GeneralRe: Get name of system folder [using C#] Pin
DaveyM696-May-11 21:07
professionalDaveyM696-May-11 21:07 
GeneralRe: Get name of system folder [using C#] Pin
DaveAuld6-May-11 21:10
professionalDaveAuld6-May-11 21:10 
GeneralRe: Get name of system folder [using C#] Pin
DaveyM696-May-11 21:27
professionalDaveyM696-May-11 21:27 
GeneralRe: Get name of system folder [using C#] Pin
shivamkalra7-May-11 5:22
shivamkalra7-May-11 5:22 
GeneralRe: Get name of system folder [using C#] Pin
Luc Pattyn7-May-11 5:30
sitebuilderLuc Pattyn7-May-11 5:30 
GeneralRe: Get name of system folder [using C#] Pin
shivamkalra7-May-11 6:20
shivamkalra7-May-11 6:20 
AnswerRe: Get name of system folder [using C#] Pin
Luc Pattyn7-May-11 6:45
sitebuilderLuc Pattyn7-May-11 6:45 
GeneralRe: Get name of system folder [using C#] Pin
shivamkalra7-May-11 6:58
shivamkalra7-May-11 6:58 
GeneralRe: Get name of system folder [using C#] Pin
Luc Pattyn7-May-11 7:10
sitebuilderLuc Pattyn7-May-11 7:10 
GeneralRe: Get name of system folder [using C#] Pin
shivamkalra7-May-11 17:30
shivamkalra7-May-11 17:30 
AnswerRe: Get name of system folder [using C#] Pin
DaveyM696-May-11 20:52
professionalDaveyM696-May-11 20:52 
AnswerRe: Get name of system folder [using C#] Pin
DaveyM696-May-11 21:25
professionalDaveyM696-May-11 21:25 
QuestionCan't publish a project even though no build errors Pin
Nathan D Cook6-May-11 9:31
Nathan D Cook6-May-11 9:31 
AnswerRe: Can't publish a project even though no build errors Pin
AspDotNetDev6-May-11 9:39
protectorAspDotNetDev6-May-11 9:39 
Questionpass a Size object to sendmessage Pin
manchukuo6-May-11 7:37
manchukuo6-May-11 7:37 
AnswerRe: pass a Size object to sendmessage Pin
DaveyM696-May-11 8:05
professionalDaveyM696-May-11 8:05 
GeneralRe: pass a Size object to sendmessage Pin
manchukuo6-May-11 8:12
manchukuo6-May-11 8:12 
GeneralRe: pass a Size object to sendmessage Pin
DaveyM696-May-11 8:27
professionalDaveyM696-May-11 8:27 
GeneralRe: pass a Size object to sendmessage [modified] Pin
manchukuo6-May-11 8:30
manchukuo6-May-11 8:30 
GeneralRe: pass a Size object to sendmessage [modified] Pin
DaveyM696-May-11 9:26
professionalDaveyM696-May-11 9:26 
GeneralRe: pass a Size object to sendmessage Pin
DaveyM696-May-11 10:13
professionalDaveyM696-May-11 10:13 
GeneralRe: pass a Size object to sendmessage Pin
DaveyM696-May-11 11:11
professionalDaveyM696-May-11 11:11 
GeneralRe: pass a Size object to sendmessage Pin
manchukuo6-May-11 11:14
manchukuo6-May-11 11:14 
QuestionRandom numbers [modified] Pin
meet_ssr6-May-11 2:46
meet_ssr6-May-11 2:46 
Hello,
How do I generate random numbers, say between 1 and 10, that return all the 10 numbers without repeatedly looping? Is there a way doing that in C#?

Thanks David, Luc Pattyn, PIEBALDconsult, orc_orc_orc, Prasanta_Prince for your all your responses and appreciate your time. I'll try the solutions provided by you

Little clarification on 'Repeatedly looping' (sorry for not being clear):
Lets say that if I want to generate random numbers between 1 and n, I use, say, rand() method that returns a random value every time I call this method. But there are chances that I get duplicate numbers being generated. So I need to skip (ignore) this duplicate number since it was already generated. But there is no guarantee that the same number doesn't appear again and again. So I need to keep looping until I get all the n numbers. The number of loops could grow as n grows, say 500. Is there a way to avoid the duplicates without doing a 'check' so that I can avoid extra loops? Performance is a concern.

Again thanks for your responses.
modified on Saturday, May 7, 2011 3:38 AM

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.