Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
GeneralRe: media not adding to play list Pin
uglyeyes13-Jul-09 17:54
uglyeyes13-Jul-09 17:54 
GeneralRe: media not adding to play list Pin
uglyeyes14-Jul-09 13:39
uglyeyes14-Jul-09 13:39 
GeneralRe: media not adding to play list Pin
uglyeyes14-Jul-09 17:05
uglyeyes14-Jul-09 17:05 
Questionhow to generate 0's and 1's only through Random Class... Pin
spalanivel13-Jul-09 1:47
spalanivel13-Jul-09 1:47 
AnswerRe: how to generate 0's and 1's only through Random Class... Pin
Anindya Chatterjee13-Jul-09 2:02
Anindya Chatterjee13-Jul-09 2:02 
GeneralRe: how to generate 0's and 1's only through Random Class... Pin
spalanivel13-Jul-09 2:13
spalanivel13-Jul-09 2:13 
GeneralRe: how to generate 0's and 1's only through Random Class... Pin
Anindya Chatterjee13-Jul-09 2:48
Anindya Chatterjee13-Jul-09 2:48 
AnswerRe: how to generate 0's and 1's only through Random Class... Pin
Luc Pattyn13-Jul-09 3:01
sitebuilderLuc Pattyn13-Jul-09 3:01 
spalanivel wrote:
private int RandomNumber(int min, int max) {
Random random = new Random();
return random.Next(min, max);
}


Don't create Random objects all the time, it makes no sense, since the Random class guarantees Next() will generate random numbers INSIDE a Random object, not AMONGST different Random objects. Instead create your Random object once, and keep a reference to it as a class member.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

QuestionHow to Use PropertyGrid for Complex Class Pin
Anindya Chatterjee13-Jul-09 1:45
Anindya Chatterjee13-Jul-09 1:45 
AnswerRe: How to Use PropertyGrid for Complex Class Pin
Henry Minute13-Jul-09 3:13
Henry Minute13-Jul-09 3:13 
GeneralRe: How to Use PropertyGrid for Complex Class Pin
Anindya Chatterjee13-Jul-09 3:16
Anindya Chatterjee13-Jul-09 3:16 
QuestionUpdating Text File Pin
vishal moharikar13-Jul-09 1:27
vishal moharikar13-Jul-09 1:27 
AnswerRe: Updating Text File Pin
musefan13-Jul-09 4:00
musefan13-Jul-09 4:00 
GeneralRe: Updating Text File Pin
vishal moharikar15-Jul-09 19:20
vishal moharikar15-Jul-09 19:20 
GeneralRe: Updating Text File Pin
musefan15-Jul-09 21:52
musefan15-Jul-09 21:52 
GeneralRe: Updating Text File Pin
vishal moharikar19-Jul-09 18:27
vishal moharikar19-Jul-09 18:27 
Questionhow to check Pin
Nath13-Jul-09 1:19
Nath13-Jul-09 1:19 
AnswerRe: how to check Pin
DaveyM6913-Jul-09 1:27
professionalDaveyM6913-Jul-09 1:27 
AnswerRe: how to check Pin
Nagy Vilmos13-Jul-09 1:29
professionalNagy Vilmos13-Jul-09 1:29 
Questioncreating services in C#.NET Pin
Sujay chakraborty13-Jul-09 0:41
Sujay chakraborty13-Jul-09 0:41 
AnswerRe: creating services in C#.NET Pin
stancrm13-Jul-09 0:48
stancrm13-Jul-09 0:48 
QuestionManaging another .exe from code Pin
Hum Dum13-Jul-09 0:32
Hum Dum13-Jul-09 0:32 
AnswerRe: Managing another .exe from code Pin
Mirko198013-Jul-09 0:39
Mirko198013-Jul-09 0:39 
GeneralRe: Managing another .exe from code Pin
Hum Dum13-Jul-09 1:05
Hum Dum13-Jul-09 1:05 
GeneralRe: Managing another .exe from code Pin
Mirko198013-Jul-09 2:41
Mirko198013-Jul-09 2:41 

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.