Advertisement
Guest User

Untitled

a guest
May 6th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.39 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Security.Cryptography;
  6.  
  7. namespace B_2009
  8. {
  9. class B_2009_OS
  10. {
  11. static void Crash(int param, char ch, string astr)
  12. {
  13. for (; ; )
  14. {
  15. param++;
  16. Console.WriteLine(param + "Error: Invalid code on error: Error: Error: Unable to generate error: Error: Error on: ");
  17. }
  18. //Param has been increased by 1
  19. ch++;
  20. //ch++
  21. astr = "String has been reset";
  22. }
  23. static void PrintHead(string bstr)
  24. {
  25. Console.WriteLine(@" ______ _____ __ _ ");
  26. Console.WriteLine(@" | ___ \ / ___| / _| | ");
  27. Console.WriteLine(@" | |_/ / ___ ___\ `--. ___ | |_| |_ ");
  28. Console.WriteLine(@" | ___ \/ _ \/ _ \`--. \/ _ \| _| __|");
  29. Console.WriteLine(@" | |_/ / __/ __/\__/ / (_) | | | |_ ");
  30. Console.WriteLine(@" \____/ \___|\___\____/ \___/|_| \__|");
  31. Console.WriteLine(" B 2009 EXP");
  32. Console.WriteLine(" Operating System\n\n");
  33. }
  34. static void Main(string[] args)
  35. {
  36. bool admin;
  37. bool access;
  38. //BEGIN GENERAL CODE TO INITIALIZE--------------------------------------------------------------
  39. Console.WriteLine(@" ______ _____ __ _ ");
  40. Console.WriteLine(@" | ___ \ / ___| / _| | ");
  41. Console.WriteLine(@" | |_/ / ___ ___\ `--. ___ | |_| |_ ");
  42. Console.WriteLine(@" | ___ \/ _ \/ _ \`--. \/ _ \| _| __|");
  43. Console.WriteLine(@" | |_/ / __/ __/\__/ / (_) | | | |_ ");
  44. Console.WriteLine(@" \____/ \___|\___\____/ \___/|_| \__|");
  45. Console.WriteLine(" B 2009 EXP");
  46. Console.WriteLine(" Operating System\n\n\n\n\n");
  47. Console.WriteLine(" Welcome to B 2009\n\n");
  48. Console.WriteLine("(C) Copyright 2009 BeeSoft Corporation, Bertrand Stone");
  49. Console.WriteLine("Thanks to Nightgunner5 for the password entry system and the logo");
  50. login:
  51. Console.WriteLine("Login\n---------------");
  52. Console.Write("Enter username: ");
  53. string username;
  54. username = Console.ReadLine();
  55. Console.Write("Enter password: ");
  56. string password;
  57. password = "";
  58. while (username != "guest")
  59. {
  60. ConsoleKeyInfo passchar = Console.ReadKey(true);
  61. if (passchar.Key == ConsoleKey.Backspace)
  62. {
  63. if (password.Length > 0)
  64. Console.CursorLeft--;
  65. password = password.Remove(password.Length - 1, 1);
  66. }
  67. else if (passchar.Key == ConsoleKey.Enter)
  68. {
  69. break;
  70. }
  71. else
  72. {
  73. password += passchar.KeyChar.ToString();
  74. Console.CursorLeft++;
  75. }
  76. }
  77. MD5 hasher = MD5.Create();
  78. byte[] passwordbytes = Encoding.UTF8.GetBytes(password);
  79. string passhash = Convert.ToBase64String(hasher.ComputeHash(passwordbytes));
  80. // At this point, we could take the information above and check to make sure it's the same as the info we have stored.
  81. Console.WriteLine("\n");
  82. Console.WriteLine("B 2009 Operating System\n\n");
  83. if (username == "guest")
  84. {
  85. Console.WriteLine("Welcome, guest user!");
  86. admin = false;
  87. }
  88. else if (username == "administrator" && password == "adpass")
  89. {
  90. Console.WriteLine("Welcome, " + username + '!' + '\n');
  91. admin = true;
  92. }
  93. else if (username == "bertrand" && password == "7333240421")
  94. {
  95. Console.WriteLine("Welcome, " + username + '!' + '\n');
  96. admin = true;
  97. }
  98. else if (username == "Nightgunner5" && passhash == "Pk3OGQyFcrZMG4kYvBCm6A==")
  99. {
  100. Console.WriteLine("Welcome, " + username + '!' + '\n');
  101. admin = true;
  102. }
  103. else if (username == "heather" && password == "happyduckhead_idk")
  104. {
  105. Console.WriteLine("Welcome, " + username + '!' + '\n');
  106. admin = true;
  107. }
  108. else if (username == "ssaamm" && password == "FREDWARDBEEFBURGER")
  109. {
  110. Console.WriteLine("Welcome, " + username + '!' + '\n');
  111. admin = true;
  112. }
  113. else
  114. {
  115. Console.WriteLine("ACCESS DENIED");
  116. goto login;
  117. }
  118. //Sequence 1: Desktop access(General Cp)
  119. string s;
  120. desktop:
  121. Console.WriteLine("Sequence 1");
  122. Console.WriteLine("Access desktop");
  123. Console.Write("Cp>>");
  124. s = Console.ReadLine();
  125. //desktop access Cp>>
  126.  
  127. if (s == "desktop>>||")
  128. {
  129. Console.Clear();
  130. Console.WriteLine("DESKTOP\n----------------------------------------\n\n\n\n\n");
  131. //Sequence 2: program access( Cp )
  132. Console.WriteLine("Sequence 2: Input command KeyCode");
  133. Console.Write("Cp>>");
  134. s = Console.ReadLine();
  135. goto squeak2start;
  136. }
  137. //if not goto desktop and try for valid KeyCode
  138. else
  139. {
  140. Console.WriteLine("\a\n\nPlease enter a valid keycode.\n");
  141. goto desktop;
  142. }
  143. //Check for application keycodes
  144. squeak2start:
  145. //check for PRCP
  146. if (s == "PRCP>>||")
  147. {
  148. Console.Clear();
  149. Console.WriteLine("\nWelcome to PRCP\n");
  150. goto PRCP;
  151. }
  152. else
  153. {
  154. Console.Clear();
  155. Console.WriteLine("Processing...\a\a\a");
  156. Console.WriteLine("Processor error: no such command.\n");
  157. Console.WriteLine("\n\n\nDESKTOP\n----------------------------------------\n");
  158. Console.Write("Cp>>");
  159. s = Console.ReadLine();
  160. goto squeak2start;
  161. }
  162. //END GENERAL CODE-----------------------------------------------------------------------
  163.  
  164. //BEGIN PRCP-----------------------------------------------------------------------------
  165. PRCP:
  166. //CodeCommands ( Pr )
  167. if (admin == true)
  168. {
  169. access = true;
  170. }
  171. else
  172. {
  173. access = false;
  174. }
  175. if (access == false)
  176. {
  177. Console.WriteLine("AdministratorStat = FALSE; ACCESS TO PRCP DENIED");
  178. goto End;
  179. }
  180. Console.Clear();
  181. Console.WriteLine("Select: Cp, Pr or CFLOW (CFLOW is the default)");
  182. string cpprcflow;
  183. cpprcflow = Console.ReadLine();
  184. if (cpprcflow == "pr")
  185. {
  186. PR:
  187. Console.Clear();
  188. B_2009_OS.PrintHead("BeeSoft");
  189. Console.Write("Pr>>");
  190. string prs;
  191. prs = Console.ReadLine();
  192. switch (prs)
  193. {
  194. case "exit*":
  195. goto End;
  196. case "desktop*":
  197. goto desktop;
  198. case "crash*":
  199. goto crash;
  200. case "info*":
  201. goto info;
  202. case "dir*":
  203. goto List;
  204. //++ cases@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  205. default:
  206. Console.WriteLine("Error: Invalid command\a");
  207. goto PR;
  208. }
  209. }
  210. else if (cpprcflow == "cp")
  211. {
  212. CP:
  213. Console.Clear();
  214. B_2009_OS.PrintHead("BeeSoft");
  215. Console.Write("Cp>>");
  216. string cps;
  217. cps = Console.ReadLine();
  218. switch (cps)
  219. {
  220. case "exit>>||":
  221. goto End;
  222. case "desktop>>||":
  223. goto desktop;
  224. case "crash>>||":
  225. goto crash;
  226. case "info>>||":
  227. goto info;
  228. case "dir>>||":
  229. goto List;
  230. //++ cases@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  231. default:
  232. Console.WriteLine("Error: Invalid command\a");
  233. goto CP;
  234. }
  235. }
  236. else
  237. {
  238. CF:
  239. Console.Clear();
  240. B_2009_OS.PrintHead("BeeSoft");
  241. Console.Write("C>>");
  242. string cfs;
  243. cfs = Console.ReadLine();
  244. switch (cfs)
  245. {
  246. case "exit|":
  247. goto End;
  248. case "desktop|":
  249. goto desktop;
  250. case "crash|":
  251. goto crash;
  252. case "info|":
  253. goto info;
  254. case "system|":
  255. goto CFIFS;
  256. case "dir|":
  257. goto List;
  258. //++ cases@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  259. default:
  260. Console.WriteLine("Error: Invalid command\a");
  261. goto CF;
  262. }
  263. CFIFS:
  264. Console.Clear();
  265. B_2009_OS.PrintHead("BeeSoft");
  266. Console.Write("C>>System>>Control>>");
  267. string csc;
  268. csc = Console.ReadLine();
  269. if (csc == "beep|")
  270. {
  271. Console.WriteLine("\a");
  272. goto CFIFS;
  273. }
  274. else if (csc == "exit|")
  275. {
  276. goto End;
  277. }
  278. else if (csc == "cflow")
  279. {
  280. goto CF;
  281. }
  282. //else if...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  283. else
  284. {
  285. Console.WriteLine("Error: Invalid SYSTEM.CONTROL command\a");
  286. Console.Clear();
  287. goto CFIFS;
  288. }
  289. }
  290. //END PRCP-----------------------------------------------------------------------------
  291. crash:
  292. for (; ; )
  293. {
  294. B_2009_OS.Crash(3, 'a', "STR");
  295. }
  296. info:
  297. 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.");
  298. Console.ReadLine();
  299. goto PRCP;
  300. List:
  301. System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(@"C:\");
  302.  
  303. foreach (System.IO.FileInfo file in dir.GetFiles("*.*"))
  304. {
  305. Console.WriteLine("{0}, {1}", file.Name, file.Length);
  306. }
  307. Console.ReadLine();
  308. goto PRCP;
  309. End:
  310. {
  311.  
  312. }
  313. }
  314. }
  315. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement