Click here to Skip to main content
15,907,392 members
Home / Discussions / C#
   

C#

 
AnswerRe: Help access image from the internet Pin
Dave Kreskowiak13-May-09 9:38
mveDave Kreskowiak13-May-09 9:38 
GeneralRe: Help access image from the internet Pin
Alex_xso14-May-09 8:21
Alex_xso14-May-09 8:21 
GeneralRe: Help access image from the internet Pin
Dave Kreskowiak14-May-09 17:51
mveDave Kreskowiak14-May-09 17:51 
QuestionHow does one have mdichildren forms automatically sized to fit the parent form? Pin
Lecutus113-May-09 9:06
Lecutus113-May-09 9:06 
AnswerRe: How does one have mdichildren forms automatically sized to fit the parent form? Pin
DaveyM6913-May-09 10:55
professionalDaveyM6913-May-09 10:55 
GeneralRe: How does one have mdichildren forms automatically sized to fit the parent form? Pin
Lecutus114-May-09 8:41
Lecutus114-May-09 8:41 
GeneralRe: How does one have mdichildren forms automatically sized to fit the parent form? Pin
DaveyM6915-May-09 4:38
professionalDaveyM6915-May-09 4:38 
QuestionSortedList, Key as element of Value Pin
Aaron Hartley13-May-09 8:37
Aaron Hartley13-May-09 8:37 
AnswerRe: SortedList, Key as element of Value Pin
OriginalGriff13-May-09 8:51
mveOriginalGriff13-May-09 8:51 
GeneralRe: SortedList, Key as element of Value Pin
Aaron Hartley13-May-09 9:40
Aaron Hartley13-May-09 9:40 
GeneralRe: SortedList, Key as element of Value Pin
OriginalGriff13-May-09 9:49
mveOriginalGriff13-May-09 9:49 
AnswerRe: SortedList, Key as element of Value Pin
Luc Pattyn13-May-09 9:24
sitebuilderLuc Pattyn13-May-09 9:24 
GeneralRe: SortedList, Key as element of Value Pin
Aaron Hartley13-May-09 9:46
Aaron Hartley13-May-09 9:46 
GeneralRe: SortedList, Key as element of Value Pin
OriginalGriff13-May-09 9:51
mveOriginalGriff13-May-09 9:51 
AnswerRe: SortedList, Key as element of Value Pin
Kythen13-May-09 9:31
Kythen13-May-09 9:31 
QuestionC# Console Application Pin
bigjoe11a13-May-09 7:49
bigjoe11a13-May-09 7:49 
AnswerRe: C# Console Application Pin
Jimmanuel13-May-09 8:10
Jimmanuel13-May-09 8:10 
GeneralRe: C# Console Application Pin
bigjoe11a13-May-09 8:17
bigjoe11a13-May-09 8:17 
GeneralRe: C# Console Application Pin
Jimmanuel13-May-09 8:38
Jimmanuel13-May-09 8:38 
GeneralRe: C# Console Application Pin
bigjoe11a13-May-09 10:00
bigjoe11a13-May-09 10:00 
GeneralRe: C# Console Application Pin
Jimmanuel13-May-09 11:33
Jimmanuel13-May-09 11:33 
GeneralRe: C# Console Application Pin
OriginalGriff13-May-09 8:43
mveOriginalGriff13-May-09 8:43 
Rule 1: Use the "code block" button below to preserve formatting. It makes things easier to read.
Rule 2: unless you are a seriously experienced programmer and there is a very good reason, do not use goto. It will earn you nothing but grief and abuse here.
Rule 3: Learn about loops. Learn about data types. Learn at least the basics of C#.
Rule 4: Learn there is a difference between "Console" and "Terminal" (one exists, the other doesn't)

Having said that, I'm in a good mood:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Demo
    {
    class Program
        {
        static void Main(string[] args)
            {
            string name;
            Console.Write("Enter your name: ");
            name = Console.ReadLine();

            Console.WriteLine("\nWelcome : " + name);
            Console.WriteLine("1) Game Menu");
            Console.WriteLine("2) List Users");
            Console.WriteLine("3) Help");
            Console.WriteLine("9) Quit");
            Console.Write("Choice : (1,2,3 or 9) ");
            int i = 0;
            do
                {
                string s = Console.ReadLine();
                if (s == "")
                    {
                    continue;
                    }
                i = s[0];
                switch (i)
                    {
                    case '1':
                        Console.WriteLine("Game selected");
                        // Handle game.
                        break;
                    case '2':
                        Console.WriteLine("List selected");
                        // List users
                        break;
                    case '3':
                        Console.WriteLine("Help selected");
                        // Help
                        break;
                    case '9':
                        Console.WriteLine("Quit selected");
                        break;
                    default:
                        Console.WriteLine("Invalid Key");
                        break;
                    }
                }
            while (i != '9');
            }
        }
    }


This is not perfect (I threw it together from your code), but it has the advantage of working...
Now, for your homework, please post a complete explaination of how it works.

No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

GeneralRe: C# Console Application Pin
bigjoe11a13-May-09 10:26
bigjoe11a13-May-09 10:26 
GeneralRe: C# Console Application Pin
OriginalGriff13-May-09 22:24
mveOriginalGriff13-May-09 22:24 
GeneralRe: C# Console Application Pin
bigjoe11a14-May-09 4:12
bigjoe11a14-May-09 4:12 

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.