Click here to Skip to main content
15,899,825 members
Home / Discussions / C#
   

C#

 
AnswerRe: Need to access value from app.config file Pin
Craig G Fraser24-Oct-06 20:39
Craig G Fraser24-Oct-06 20:39 
Questionrandom numbers Pin
Jad Jadallah24-Oct-06 10:18
Jad Jadallah24-Oct-06 10:18 
AnswerRe: random numbers Pin
Jim Conigliaro24-Oct-06 10:53
Jim Conigliaro24-Oct-06 10:53 
GeneralRe: random numbers Pin
Jad Jadallah24-Oct-06 11:13
Jad Jadallah24-Oct-06 11:13 
AnswerRe: random numbers Pin
Guffa24-Oct-06 12:10
Guffa24-Oct-06 12:10 
GeneralRe: random numbers Pin
Jad Jadallah24-Oct-06 12:24
Jad Jadallah24-Oct-06 12:24 
AnswerRe: random numbers Pin
Guffa24-Oct-06 13:11
Guffa24-Oct-06 13:11 
AnswerRe: random numbers Pin
Guffa25-Oct-06 7:44
Guffa25-Oct-06 7:44 
Blackocebo wrote:
Hello man,

I was impressed by your posts and i really need your help. i am creating a card game ( some kind of poker) to give it to my friend in order to play it for free and no more spend money to play it.

I have recently finished the game but i am facing a problem, when pressing the (DEAL) button sometimes, at some points, the application freezes. The CPU usage reaches 100%. So i want to ask you as an expert what should i do.

[lengthy code not included]


Well, let's look at a part of the code:

num2 = randomnum.Next(1, 14);
kind2 = randomnum.Next(1, 5);
string string2 = num2.ToString() + kind2.ToString();
while (string2 == string1)
{
num2 = randomnum.Next(1, 14);
kind2 = randomnum.Next(1, 5);
}


As you don't change any of the strings inside the loop, that you use in the condition, if you ever enter into the loop, you will never exit.

The same of course applies to the three following loops too.




---
b { font-weight: normal; }

GeneralRe: random numbers Pin
Jad Jadallah25-Oct-06 8:44
Jad Jadallah25-Oct-06 8:44 
Questiondelete files from a directory Pin
keroed_edmond24-Oct-06 10:18
keroed_edmond24-Oct-06 10:18 
AnswerRe: delete files from a directory Pin
Jim Conigliaro24-Oct-06 11:03
Jim Conigliaro24-Oct-06 11:03 
QuestionTransactions between layers Pin
Luis C. Lopez24-Oct-06 9:32
Luis C. Lopez24-Oct-06 9:32 
AnswerRe: Transactions between layers Pin
Dustin Metzgar24-Oct-06 9:46
Dustin Metzgar24-Oct-06 9:46 
GeneralRe: Transactions between layers Pin
Luis C. Lopez24-Oct-06 10:01
Luis C. Lopez24-Oct-06 10:01 
QuestionShould I have outlook in order to show mht file in my c# application? Pin
AngryC24-Oct-06 7:47
AngryC24-Oct-06 7:47 
AnswerRe: Should I have outlook in order to show mht file in my c# application? Pin
Dave Kreskowiak24-Oct-06 8:11
mveDave Kreskowiak24-Oct-06 8:11 
AnswerRe: Should I have outlook in order to show mht file in my c# application? Pin
bradsnobar24-Oct-06 8:43
bradsnobar24-Oct-06 8:43 
QuestionMessagebox pop up behind mainform Pin
bradsnobar24-Oct-06 7:34
bradsnobar24-Oct-06 7:34 
AnswerRe: Messagebox pop up behind mainform Pin
engsrini24-Oct-06 18:53
engsrini24-Oct-06 18:53 
QuestionTranslating key codes to a System.Windows.Forms.Keys value. Pin
Shy Agam24-Oct-06 6:25
Shy Agam24-Oct-06 6:25 
AnswerRe: Translating key codes to a System.Windows.Forms.Keys value. Pin
Ed.Poore24-Oct-06 6:32
Ed.Poore24-Oct-06 6:32 
GeneralRe: Translating key codes to a System.Windows.Forms.Keys value. Pin
Shy Agam24-Oct-06 6:48
Shy Agam24-Oct-06 6:48 
GeneralRe: Translating key codes to a System.Windows.Forms.Keys value. Pin
Ed.Poore24-Oct-06 12:08
Ed.Poore24-Oct-06 12:08 
GeneralRe: Translating key codes to a System.Windows.Forms.Keys value. Pin
Ed.Poore24-Oct-06 12:09
Ed.Poore24-Oct-06 12:09 
GeneralRe: Translating key codes to a System.Windows.Forms.Keys value. Pin
Shy Agam24-Oct-06 12:43
Shy Agam24-Oct-06 12:43 

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.