Couldn't you just use a switch statement? Like so:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string input;
Console.WriteLine("Please enter a username");
input = Console.ReadLine();
if (input != "John")
{
error();
}
Console.WriteLine("Please enter a password");
input = Console.ReadLine();
if (input == "Smith")
menu();
if (input != "Smith")
error();
}
static void menu()
{
Console.WriteLine("Welcome!");
Console.WriteLine("Please enter a command");
string input = (int)Console.ReadLine();
switch(input)
{
case 1:
case 2:
case 3:
case 4:
}
}
I just wrote this now, so didn't test it... It should work though.