Advertisement
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;
- using System.Security.Cryptography;
- namespace B_2009
- {
- class B_2009_OS
- {
- static void Crash(int param, char ch, string astr)
- {
- for (; ; )
- {
- param++;
- Console.WriteLine(param + "Error: Invalid code on error: Error: Error: Unable to generate error: Error: Error on: ");
- }
- //Param has been increased by 1
- ch++;
- //ch++
- astr = "String has been reset";
- }
- static void PrintHead(string bstr)
- {
- Console.WriteLine(@" ______ _____ __ _ ");
- Console.WriteLine(@" | ___ \ / ___| / _| | ");
- Console.WriteLine(@" | |_/ / ___ ___\ `--. ___ | |_| |_ ");
- Console.WriteLine(@" | ___ \/ _ \/ _ \`--. \/ _ \| _| __|");
- Console.WriteLine(@" | |_/ / __/ __/\__/ / (_) | | | |_ ");
- Console.WriteLine(@" \____/ \___|\___\____/ \___/|_| \__|");
- Console.WriteLine(" B 2009 EXP");
- Console.WriteLine(" Operating System\n\n");
- }
- static void Main(string[] args)
- {
- bool admin;
- bool access;
- //BEGIN GENERAL CODE TO INITIALIZE--------------------------------------------------------------
- Console.WriteLine(@" ______ _____ __ _ ");
- Console.WriteLine(@" | ___ \ / ___| / _| | ");
- Console.WriteLine(@" | |_/ / ___ ___\ `--. ___ | |_| |_ ");
- Console.WriteLine(@" | ___ \/ _ \/ _ \`--. \/ _ \| _| __|");
- Console.WriteLine(@" | |_/ / __/ __/\__/ / (_) | | | |_ ");
- Console.WriteLine(@" \____/ \___|\___\____/ \___/|_| \__|");
- Console.WriteLine(" B 2009 EXP");
- Console.WriteLine(" Operating System\n\n\n\n\n");
- Console.WriteLine(" Welcome to B 2009\n\n");
- Console.WriteLine("(C) Copyright 2009 BeeSoft Corporation, Bertrand Stone");
- Console.WriteLine("Thanks to Nightgunner5 for the password entry system and the logo");
- login:
- Console.WriteLine("Login\n---------------");
- Console.Write("Enter username: ");
- string username;
- username = Console.ReadLine();
- Console.Write("Enter password: ");
- string password;
- password = "";
- while (username != "guest")
- {
- ConsoleKeyInfo passchar = Console.ReadKey(true);
- if (passchar.Key == ConsoleKey.Backspace)
- {
- if (password.Length > 0)
- Console.CursorLeft--;
- password = password.Remove(password.Length - 1, 1);
- }
- else if (passchar.Key == ConsoleKey.Enter)
- {
- break;
- }
- else
- {
- password += passchar.KeyChar.ToString();
- Console.CursorLeft++;
- }
- }
- MD5 hasher = MD5.Create();
- byte[] passwordbytes = Encoding.UTF8.GetBytes(password);
- string passhash = Convert.ToBase64String(hasher.ComputeHash(passwordbytes));
- // At this point, we could take the information above and check to make sure it's the same as the info we have stored.
- Console.WriteLine("\n");
- Console.WriteLine("B 2009 Operating System\n\n");
- if (username == "guest")
- {
- Console.WriteLine("Welcome, guest user!");
- admin = false;
- }
- else if (username == "administrator" && password == "adpass")
- {
- Console.WriteLine("Welcome, " + username + '!' + '\n');
- admin = true;
- }
- else if (username == "bertrand" && password == "7333240421")
- {
- Console.WriteLine("Welcome, " + username + '!' + '\n');
- admin = true;
- }
- else if (username == "Nightgunner5" && passhash == "Pk3OGQyFcrZMG4kYvBCm6A==")
- {
- Console.WriteLine("Welcome, " + username + '!' + '\n');
- admin = true;
- }
- else if (username == "heather" && password == "happyduckhead_idk")
- {
- Console.WriteLine("Welcome, " + username + '!' + '\n');
- admin = true;
- }
- else if (username == "ssaamm" && password == "FREDWARDBEEFBURGER")
- {
- Console.WriteLine("Welcome, " + username + '!' + '\n');
- admin = true;
- }
- else
- {
- Console.WriteLine("ACCESS DENIED");
- goto login;
- }
- //Sequence 1: Desktop access(General Cp)
- string s;
- desktop:
- Console.WriteLine("Sequence 1");
- Console.WriteLine("Access desktop");
- Console.Write("Cp>>");
- s = Console.ReadLine();
- //desktop access Cp>>
- if (s == "desktop>>||")
- {
- Console.Clear();
- Console.WriteLine("DESKTOP\n----------------------------------------\n\n\n\n\n");
- //Sequence 2: program access( Cp )
- Console.WriteLine("Sequence 2: Input command KeyCode");
- Console.Write("Cp>>");
- s = Console.ReadLine();
- goto squeak2start;
- }
- //if not goto desktop and try for valid KeyCode
- else
- {
- Console.WriteLine("\a\n\nPlease enter a valid keycode.\n");
- goto desktop;
- }
- //Check for application keycodes
- squeak2start:
- //check for PRCP
- if (s == "PRCP>>||")
- {
- Console.Clear();
- Console.WriteLine("\nWelcome to PRCP\n");
- goto PRCP;
- }
- else
- {
- Console.Clear();
- Console.WriteLine("Processing...\a\a\a");
- Console.WriteLine("Processor error: no such command.\n");
- Console.WriteLine("\n\n\nDESKTOP\n----------------------------------------\n");
- Console.Write("Cp>>");
- s = Console.ReadLine();
- goto squeak2start;
- }
- //END GENERAL CODE-----------------------------------------------------------------------
- //BEGIN PRCP-----------------------------------------------------------------------------
- PRCP:
- //CodeCommands ( Pr )
- if (admin == true)
- {
- access = true;
- }
- else
- {
- access = false;
- }
- if (access == false)
- {
- Console.WriteLine("AdministratorStat = FALSE; ACCESS TO PRCP DENIED");
- goto End;
- }
- Console.Clear();
- Console.WriteLine("Select: Cp, Pr or CFLOW (CFLOW is the default)");
- string cpprcflow;
- cpprcflow = Console.ReadLine();
- if (cpprcflow == "pr")
- {
- PR:
- Console.Clear();
- B_2009_OS.PrintHead("BeeSoft");
- Console.Write("Pr>>");
- string prs;
- prs = Console.ReadLine();
- switch (prs)
- {
- case "exit*":
- goto End;
- case "desktop*":
- goto desktop;
- case "crash*":
- goto crash;
- case "info*":
- goto info;
- case "dir*":
- goto List;
- //++ cases@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- default:
- Console.WriteLine("Error: Invalid command\a");
- goto PR;
- }
- }
- else if (cpprcflow == "cp")
- {
- CP:
- Console.Clear();
- B_2009_OS.PrintHead("BeeSoft");
- Console.Write("Cp>>");
- string cps;
- cps = Console.ReadLine();
- switch (cps)
- {
- case "exit>>||":
- goto End;
- case "desktop>>||":
- goto desktop;
- case "crash>>||":
- goto crash;
- case "info>>||":
- goto info;
- case "dir>>||":
- goto List;
- //++ cases@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- default:
- Console.WriteLine("Error: Invalid command\a");
- goto CP;
- }
- }
- else
- {
- CF:
- Console.Clear();
- B_2009_OS.PrintHead("BeeSoft");
- Console.Write("C>>");
- string cfs;
- cfs = Console.ReadLine();
- switch (cfs)
- {
- case "exit|":
- goto End;
- case "desktop|":
- goto desktop;
- case "crash|":
- goto crash;
- case "info|":
- goto info;
- case "system|":
- goto CFIFS;
- case "dir|":
- goto List;
- //++ cases@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- default:
- Console.WriteLine("Error: Invalid command\a");
- goto CF;
- }
- CFIFS:
- Console.Clear();
- B_2009_OS.PrintHead("BeeSoft");
- Console.Write("C>>System>>Control>>");
- string csc;
- csc = Console.ReadLine();
- if (csc == "beep|")
- {
- Console.WriteLine("\a");
- goto CFIFS;
- }
- else if (csc == "exit|")
- {
- goto End;
- }
- else if (csc == "cflow")
- {
- goto CF;
- }
- //else if...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- else
- {
- Console.WriteLine("Error: Invalid SYSTEM.CONTROL command\a");
- Console.Clear();
- goto CFIFS;
- }
- }
- //END PRCP-----------------------------------------------------------------------------
- crash:
- for (; ; )
- {
- B_2009_OS.Crash(3, 'a', "STR");
- }
- info:
- Console.WriteLine("PRCP is designed as an adaptable prompt form console system programming language, PRogramming Command Prompt NETWork. B 2009 also includes an even more advanced system flow, CFLOW. CFLOW is, without doubt, the absolute best system in PRCP-CF. Pr is good for beginners, Cp for most uses, but CFLOW is best for system access.");
- Console.ReadLine();
- goto PRCP;
- List:
- System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(@"C:\");
- foreach (System.IO.FileInfo file in dir.GetFiles("*.*"))
- {
- Console.WriteLine("{0}, {1}", file.Name, file.Length);
- }
- Console.ReadLine();
- goto PRCP;
- End:
- {
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement