Re: Hi
From: Richard Blewett [DevelopMentor] (richardb_at_develop.com)
Date: 09/27/04
- Next message: Hans Kesting: "Re: Hi"
- Previous message: Mephiston: "Re: Hi"
- In reply to: Richard Blewett [DevelopMentor]: "Re: Hi"
- Next in thread: Morten Wennevik: "Re: Hi"
- Messages sorted by: [ date ] [ thread ]
To: microsoft.public.dotnet.languages.csharp Date: Mon, 27 Sep 2004 04:12:26 -0700
Actually I'm talking rubbish - according to the docs the default constructor uses a time depent seed - ignore my post ;-)
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
The Random class has another constructor which takes a seed (a value used to start the number generator) the one you are using uses teh same seed so will produce the same sequence. Try using the TickCount (number of milliseconds since the machine started). i.e:
Random R = new Random(Environment.TickCount);
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/
Hi,
I need to use Random numbers with in Maximum Limit.
I have used Random Class from .Net Package.
Random R =new Random();
int I;
for(I = 0; I < 10; I++)
{
MessageBox.Show(R.Next(I).ToString());
}
But it gives me a duplicate random number. So if any Other Class or Source
Code for generate Random numbers in the loop variable please suggest me.
Thanks for your help
Mahendran
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.768 / Virus Database: 515 - Release Date: 22/09/2004
[microsoft.public.dotnet.languages.csharp]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.768 / Virus Database: 515 - Release Date: 22/09/2004
[microsoft.public.dotnet.languages.csharp]
Relevant Pages
... >> Richard Blewett - DevelopMentor ... In PopulateDatasetList how is this populating the combobox? ... Regards ...
(microsoft.public.dotnet.languages.csharp)
... Diving in before Jon does;-) ... Regards ... Richard Blewett - DevelopMentor ...
(microsoft.public.dotnet.languages.csharp)
... > Richard Blewett - DevelopMentor ... >> My code DOES NOT WORK if assemblies ARE strong name. ...
(microsoft.public.dotnet.languages.csharp)
... Regards ... Richard Blewett - DevelopMentor ... the auto-generated revision number for an ...
(microsoft.public.dotnet.framework)
... Regards ... > Richard Blewett - DevelopMentor ... > In a C# application I use a message box to display an error. ...
(microsoft.public.dotnet.framework)