Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Program
- {
- static string username;
- static string password;
- static void DoLogin()
- {
- // Whatever should happend when you login
- Console.Out.WriteLine("Logged in as " + username + "!");
- return;
- }
- static void DoLogout()
- {
- // Whatever should happend when you logout
- Console.Out.WriteLine("You have successfully logged out!");
- return;
- }
- static void GetLogin()
- {
- Console.Out.Write("Enter Username: ");
- username = Console.In.ReadLine();
- Console.Out.Write("Enter Password: ");
- password = Console.In.ReadLine();
- DoLogin();
- return;
- }
- static bool GetInput()
- {
- Console.Out.Write(">>> ");
- string Text = Console.In.ReadLine();
- switch (Text)
- {
- /* Incase you don't know the switch statement, it's like if, else if, else.
- * Typing case "String here":
- * Code to occur if Text equlals the case
- * break;
- * Or default:
- * Code to occur if it didn't match any of them (else)
- * break;
- */
- case "exit":
- return false;
- case "logout":
- DoLogout();
- GetLogin();
- break;
- default:
- Console.Out.Write("Unknown command entered!\n");
- break;
- }
- return true;
- }
- static void Main(string[] args)
- {
- Console.Out.Write("--- Onion Steam Version 1.0 ---\n\n");
- GetLogin();
- input:
- bool i = GetInput();
- if (!i)
- {
- return;
- }
- else
- {
- goto input;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment