Advertisement
Guest User

Untitled

a guest
May 7th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 12.99 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. using System.Security.Cryptography;
  7. using BeeSoft.ECLIPSE_EDV;
  8. /*
  9.  * BeeSoft ECLIPSE EDV
  10.  * Express Disk Variant
  11.  * March 2009 -
  12.  * Disk utility
  13.  * (C) 2009 Bertrand Stone
  14.  * Special thanks to:
  15.  * Nightgunner5 for the password entry system and some new syntax concepts
  16.  *
  17.  *
  18.  * ssaamm for testing of B 2009 EXP, the previous BeeSoft project
  19.  *
  20.  *
  21.  * start namespace
  22. */
  23. namespace BeeSoft.ECLIPSE_EDV
  24. {
  25.     //class
  26.     class Program
  27.     {
  28.         //crash function
  29.         public static void Crash()
  30.         {
  31.             for (; ; )
  32.             {
  33.                 Console.Write("Error: ");
  34.             }
  35.         }
  36.         /* printhead - B*/
  37.         public static void PrintHead()
  38.         {
  39.             Console.WriteLine(@"               ");
  40.             Console.WriteLine(@"                              ");
  41.             Console.WriteLine(@"                                  _---------_     ");
  42.             Console.WriteLine(@"                               _-             -_ ");
  43.             Console.WriteLine(@"                              /     ECL EDV     \");
  44.         }
  45.         /*printbeesofttitle - B*/
  46.         public static void PrintBeeSoftTitle()
  47.         {
  48.             Console.WriteLine(@"                     ______           _____        __ _   ");
  49.             Console.WriteLine(@"                     | ___ \         /  ___|      / _| |  ");
  50.             Console.WriteLine(@"                     | |_/ / ___  ___\ `--.  ___ | |_| |_ ");
  51.             Console.WriteLine(@"                     | ___ \/ _ \/ _ \`--. \/ _ \|  _| __|");
  52.             Console.WriteLine(@"                     | |_/ /  __/  __/\__/ / (_) | | | |_ ");
  53.             Console.WriteLine(@"                     \____/ \___|\___\____/ \___/|_|  \__|");
  54.         }
  55.         //Main - B
  56.         public static void Main(string[] args)
  57.         {
  58.             Console.WriteLine("Starting BeeSoft ECLIPSE EDV...");
  59.             Thread.Sleep(1000);
  60.             Console.WriteLine("Loading Startup FileSet...");
  61.             for (int x = 0; x <= 18; x++)
  62.             {
  63.                 Console.Write("_");
  64.                 Thread.Sleep(50);
  65.             }
  66.             Console.WriteLine("");
  67.             Thread.Sleep(500);
  68.             Console.WriteLine("Loading system files...");
  69.             for (int x = 0; x <= 50; x++)
  70.             {
  71.                 Console.Write("_");
  72.                 Thread.Sleep(50);
  73.             }
  74.             Console.WriteLine("");
  75.             Thread.Sleep(500);
  76.             Console.WriteLine("Final startup file load...");
  77.             Thread.Sleep(100);
  78.             for (int x = 0; x <= 40; x++)
  79.             {
  80.                 Console.Write("_");
  81.                 Thread.Sleep(50);
  82.             }
  83.             Console.WriteLine("");
  84.             Thread.Sleep(2000);
  85.             Console.Clear();
  86.             bool admin; // - judges if the user is an administrator
  87.             Console.BackgroundColor = ConsoleColor.Blue; /* for the screen coming up,
  88.                                                           * but the color system is slow
  89.                                                           * by one frame
  90.                                                           */
  91.             Console.Title = "BeeSoft ECLIPSE EDV";
  92.             Console.WriteLine("\a");
  93.             Thread.Sleep(3000);
  94.             Console.Clear(); //screening
  95.             PrintBeeSoftTitle();
  96.             PrintHead();
  97.             Console.BackgroundColor = ConsoleColor.Black; //reset the console color
  98.             Thread.Sleep(2000);
  99.             Console.Clear(); //more effects
  100.             Console.WriteLine("Loading login system...");
  101.             Thread.Sleep(1000);
  102.             /*Login system - Nightgunner5*/
  103.         login:
  104.             Thread.Sleep(1000);
  105.             Console.Clear();
  106.             Console.WriteLine("Login\n---------------");
  107.             Console.Write("Enter username: ");
  108.             string username;
  109.             username = Console.ReadLine();
  110.             Console.Write("Enter password: ");
  111.             string password;
  112.             password = "";
  113.             /*label enterpass: part of non-work code*/
  114.             while (username != "guest")
  115.             {
  116.                 ConsoleKeyInfo passchar = Console.ReadKey(true);
  117.                 if (passchar.Key == ConsoleKey.Backspace)
  118.                 {
  119.                     if (password.Length > 0)
  120.                         Console.CursorLeft--;
  121.                     password = password.Remove(password.Length - 1, 1);
  122.                     /*if ((password.Length) <= 0)
  123.                     {
  124.                         password = "";
  125.                         goto enterpass;
  126.                     }*/
  127.                     //code didn't work - "hold start index > 0"
  128.                 }
  129.                 else if (passchar.Key == ConsoleKey.Enter)
  130.                 {
  131.                     break;
  132.                 }
  133.                 else
  134.                 {
  135.                     password += passchar.KeyChar.ToString();
  136.                     Console.CursorLeft++;
  137.                 }
  138.             }
  139.             /*encrypter - Nightgunner5*/
  140.             MD5 hasher = MD5.Create();
  141.             byte[] passwordbytes = Encoding.UTF8.GetBytes(password);
  142.             string passhash = Convert.ToBase64String(hasher.ComputeHash(passwordbytes));
  143.             // At this point, we could take the information above and check to make sure it's the same as the info we have stored.
  144.             Console.WriteLine("\n");
  145.             Console.WriteLine("B 2009 Operating System\n\n");
  146.             /*user check - B*/
  147.             if (username == "guest")
  148.             {
  149.                 Console.WriteLine("Welcome, guest user!");
  150.                 admin = false;
  151.             }
  152.             else if (username == "administrator" && passhash == "R9ejHNjbTEb3hTdmOGAamg==")
  153.             {
  154.                 Console.WriteLine("Welcome, " + username + '!' + '\n');
  155.                 admin = true;
  156.             }
  157.             else if (username == "bertrand" && password == "7333240421")
  158.             {
  159.                 Console.WriteLine("Welcome, " + username + '!' + '\n');
  160.                 admin = true;
  161.             }
  162.             else if (username == "Nightgunner5" && passhash == "Pk3OGQyFcrZMG4kYvBCm6A==")
  163.             {
  164.                 Console.WriteLine("Welcome, " + username + '!' + '\n');
  165.                 admin = true;
  166.             }
  167.             else if (username == "heather" && password == "happyduckhead_idk")
  168.             {
  169.                 Console.WriteLine("Welcome, " + username + '!' + '\n');
  170.                 admin = true;
  171.             }
  172.             else if (username == "ssaamm" && password == "FREDWARDBEEFBURGER")
  173.             {
  174.                 Console.WriteLine("Welcome, " + username + '!' + '\n');
  175.                 admin = false;
  176.             }
  177.             else
  178.             {
  179.                 Console.WriteLine("ACCESS DENIED");
  180.                 goto login;
  181.             }
  182.             /*DESKTOP - B*/
  183.         desktop:
  184.             Thread.Sleep(1000);
  185.             Console.Clear();
  186.             Console.WriteLine("Loading desktop...");
  187.             Thread.Sleep(1000);
  188.             Console.Clear();
  189.             Console.WriteLine("Desktop\n-----------");
  190.             Console.WriteLine("Options: Shut Down, Programs, or Logout");
  191.             Console.WriteLine("SLC by Cp Input Stream Manager");
  192.             Console.WriteLine("Info on PRCP 2 in .pr>info*, .cp>info>>||, and C>>info|");
  193.             Console.Write("Cp>>");
  194.             string dskinp;
  195.             dskinp = Console.ReadLine();
  196.             if (dskinp == "logout>>||")
  197.             {
  198.                 goto login;
  199.             }
  200.             else if (dskinp == "shutdown>>||")
  201.             {
  202.  
  203.             }
  204.             else if (dskinp == "Programs>>||")
  205.             {
  206.                 goto ProgramSlc;
  207.             }
  208.             else
  209.             {
  210.                 Console.WriteLine("Error: Invalid command");
  211.                 Thread.Sleep(1000);
  212.                 Console.Clear();
  213.                 goto desktop;
  214.             }
  215.             /* PROGRAMS - B*/
  216.         ProgramSlc:
  217.             Console.Clear();
  218.             Console.WriteLine("Select: .pr>, .cp>, C>>:");
  219.             Console.Write("Select (CFLOW is the default): ");
  220.             string prslcinp;
  221.             prslcinp = Console.ReadLine();
  222.             if (prslcinp == ".pr>")
  223.             {
  224.                 Console.Clear();
  225.                 goto pr;
  226.             }
  227.             else if (prslcinp == ".cp>")
  228.             {
  229.                 Console.Clear();
  230.                 goto cp;
  231.             }
  232.             else
  233.             {
  234.                 Console.Clear();
  235.                 goto cf;
  236.             }
  237.         pr:
  238.             PrintBeeSoftTitle();
  239.             PrintHead();
  240.             Console.Write(".pr>");
  241.             string prs;
  242.             prs = Console.ReadLine();
  243.             if (prs == "info*")
  244.             {
  245.                 goto info;
  246.             }
  247.             else if (prs == "exit*")
  248.             {
  249.                 goto End;
  250.             }
  251.             else if (prs == "crash*")
  252.             {
  253.                 Crash();
  254.             }
  255.             else if (prs == "dir*" || prs == "system*")
  256.             {
  257.                 Console.WriteLine("FunctionCall " + "\"" + prs + "\" is not available in .pr>.");
  258.             }
  259.             //else if
  260.             else
  261.             {
  262.                 Console.WriteLine("FunctionCall " + "\"" + prs + "\" is not a valid command");
  263.                 Thread.Sleep(1000);
  264.                 Console.Clear();
  265.                 goto pr;
  266.             }
  267.         cp:
  268.             PrintBeeSoftTitle();
  269.             PrintHead();
  270.             Console.Write(".cp>");
  271.             string cps;
  272.             cps = Console.ReadLine();
  273.             if (cps == "info>>||")
  274.             {
  275.                 goto info;
  276.             }
  277.             else if (cps == "exit>>||")
  278.             {
  279.                 goto End;
  280.             }
  281.             else if (cps == "crash>>||")
  282.             {
  283.                 Crash();
  284.             }
  285.             else if (cps == "dir>>||" || cps == "system>>||")
  286.             {
  287.                 Console.WriteLine("FunctionCall " + "\"" + cps + "\" is not available in .cp>.");
  288.             }
  289.             //else if...
  290.             else
  291.             {
  292.                 Console.WriteLine("FunctionCall " + "\"" + cps + "\" is not a valid command");
  293.                 Thread.Sleep(1000);
  294.                 Console.Clear();
  295.                 goto cp;
  296.             }
  297.         cf:
  298.             PrintBeeSoftTitle();
  299.             PrintHead();
  300.             Console.Write("C>>");
  301.             string cfs;
  302.             cfs = Console.ReadLine();
  303.             if (cfs == "info|")
  304.             {
  305.                 goto info;
  306.             }
  307.             else if (cfs == "exit|")
  308.             {
  309.                 goto End;
  310.             }
  311.             else if (cfs == "crash|")
  312.             {
  313.                 Crash();
  314.             }
  315.             else if (cfs == "gotoslc|")
  316.             {
  317.                 goto ProgramSlc;
  318.             }
  319.             else if (cfs == "system|")
  320.             {
  321.             cfsc:
  322.                 string cfscontrol;
  323.                 Console.Write("C>>System>>Control>>");
  324.                 cfscontrol = Console.ReadLine();
  325.                 if (cfscontrol == "beep|")
  326.                 {
  327.                     Console.WriteLine("\a");
  328.                     goto cfsc;
  329.                 }
  330.                 else if (cfscontrol == "gotocf|")
  331.                 {
  332.                     goto cf;
  333.                 }
  334.                 //else if...
  335.                 else
  336.                 {
  337.                     Console.WriteLine("FunctionCall " + "\"" + cfscontrol + "\" is not a valid command");
  338.                     Thread.Sleep(1000);
  339.                     Console.Clear();
  340.                     goto cfsc;
  341.                 }
  342.             }
  343.             else if (cfs == "dir|" || cfs == "dir *.*|")
  344.             {
  345.                 System.IO.DirectoryInfo dirtxt = new System.IO.DirectoryInfo(@"C:\");
  346.                 foreach (System.IO.FileInfo file in dirtxt.GetFiles("*.*"))
  347.                 {
  348.                     Console.WriteLine("{0}, {1}", file.Name, file.Length);
  349.                 }
  350.                 Console.ReadLine();
  351.                 goto ProgramSlc;
  352.             }
  353.             //else if...
  354.             else
  355.             {
  356.                 Console.WriteLine("FunctionCall " + "\"" + cfs + "\" is not a valid command");
  357.                 Thread.Sleep(1000);
  358.                 Console.Clear();
  359.                 goto cf;
  360.             }
  361.         info:
  362.             Console.WriteLine("PRCP 2 Info\n--------");
  363.             Console.WriteLine("PRCP 2 includes the updated .pr> and .cp> prompts, as well as CFLOW. PRCP 2 was designed for ECLIPSE, and operates starting from ECLIPSE. .pr> is, as usual, the general form prompt. .cp> is the new version of Cp>>, and C>> is still the general form CFLOW prompt.");
  364.             Console.Read();
  365.             goto desktop;
  366.         End: //ends the program
  367.             {
  368.             }
  369.         }
  370.     }
  371. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement