Click here to Skip to main content
16,008,469 members
Home / Discussions / C#
   

C#

 
QuestionTrouble with my IF's Pin
Patrick_N3WB1E11-Dec-08 13:08
Patrick_N3WB1E11-Dec-08 13:08 
GeneralRe: Trouble with my IF's Pin
Luc Pattyn11-Dec-08 13:36
sitebuilderLuc Pattyn11-Dec-08 13:36 
AnswerRe: Trouble with my IF's Pin
Christian Graus11-Dec-08 13:45
protectorChristian Graus11-Dec-08 13:45 
GeneralRe: Trouble with my IF's Pin
PIEBALDconsult11-Dec-08 14:05
mvePIEBALDconsult11-Dec-08 14:05 
GeneralRe: Trouble with my IF's Pin
danzar11-Dec-08 18:28
danzar11-Dec-08 18:28 
GeneralRe: Trouble with my IF's Pin
Dave Kreskowiak11-Dec-08 21:43
mveDave Kreskowiak11-Dec-08 21:43 
GeneralRe: Trouble with my IF's Pin
PIEBALDconsult12-Dec-08 3:03
mvePIEBALDconsult12-Dec-08 3:03 
AnswerRe: Trouble with my IF's Pin
DaveyM6912-Dec-08 1:31
professionalDaveyM6912-Dec-08 1:31 
Wow! I haven't seen good old BASIC like that for years! It's like an old friend enemy revisiting.

This is the C# forum in case you didn't realise. A rough mock up of your code in C# in case you want to give one of these new-fangled languages a try!
string name;
ConsoleKeyInfo emoState = new ConsoleKeyInfo();
string why;
Console.Write("What is your name? ");
name = Console.ReadLine();
Console.WriteLine(string.Format("Hello {0}, how are you doing today? ", name));
while (emoState.Key != ConsoleKey.G && emoState.Key != ConsoleKey.B)
{
    Console.Write("Good (g) or bad (b)? ");
    emoState = Console.ReadKey(false);
    Console.WriteLine();
}
switch (emoState.Key)
{
    case ConsoleKey.G:
        Console.WriteLine("Thats good, tell me about it!");
        Console.Write("Why is it a good day? ");
        why = Console.ReadLine();
        break;
    default:
        Console.WriteLine("Aww, im sorry.");
        Console.Write("What was bad about your day? ");
        why = Console.ReadLine();
        break;
}
Console.Write("Press any key to exit...");
Console.Read();


Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

QuestionWhich solution is of more performance ? Instantiating new object within a for loop Pin
Nadia Monalisa11-Dec-08 13:04
Nadia Monalisa11-Dec-08 13:04 
AnswerRe: Which solution is of more performance ? Instantiating new object within a for loop Pin
Patrick_N3WB1E11-Dec-08 13:11
Patrick_N3WB1E11-Dec-08 13:11 
GeneralRe: Which solution is of more performance ? Instantiating new object within a for loop Pin
Luc Pattyn11-Dec-08 13:40
sitebuilderLuc Pattyn11-Dec-08 13:40 
AnswerRe: Which solution is of more performance ? Instantiating new object within a for loop Pin
Christian Graus11-Dec-08 13:41
protectorChristian Graus11-Dec-08 13:41 
AnswerRe: Which solution is of more performance ? Instantiating new object within a for loop Pin
PIEBALDconsult11-Dec-08 14:02
mvePIEBALDconsult11-Dec-08 14:02 
AnswerRe: Which solution is of more performance ? Instantiating new object within a for loop Pin
Tony Pottier11-Dec-08 15:49
Tony Pottier11-Dec-08 15:49 
GeneralRe: Which solution is of more performance ? Instantiating new object within a for loop Pin
PIEBALDconsult11-Dec-08 16:34
mvePIEBALDconsult11-Dec-08 16:34 
QuestionHow to get network connection name Pin
s196675m11-Dec-08 12:27
s196675m11-Dec-08 12:27 
AnswerRe: How to get network connection name Pin
Patrick_N3WB1E11-Dec-08 13:13
Patrick_N3WB1E11-Dec-08 13:13 
GeneralRe: How to get network connection name Pin
Dave Kreskowiak11-Dec-08 15:43
mveDave Kreskowiak11-Dec-08 15:43 
AnswerRe: How to get network connection name Pin
Dave Kreskowiak11-Dec-08 15:42
mveDave Kreskowiak11-Dec-08 15:42 
GeneralRe: How to get network connection name Pin
s196675m12-Dec-08 2:33
s196675m12-Dec-08 2:33 
GeneralRe: How to get network connection name Pin
s196675m12-Dec-08 2:47
s196675m12-Dec-08 2:47 
QuestionCustom Events Pin
#realJSOP11-Dec-08 10:37
professional#realJSOP11-Dec-08 10:37 
AnswerRe: Custom Events Pin
Mark Salsbery11-Dec-08 10:52
Mark Salsbery11-Dec-08 10:52 
GeneralRe: Custom Events Pin
#realJSOP11-Dec-08 12:15
professional#realJSOP11-Dec-08 12:15 
GeneralRe: Custom Events Pin
Mark Salsbery11-Dec-08 12:24
Mark Salsbery11-Dec-08 12:24 

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.