コード例 #1
0
        protected override void BeforeRun()
        {
            //filesystem
A:
            var fs = new Sys.FileSystem.CosmosVFS();

            Sys.FileSystem.VFS.VFSManager.RegisterVFS(fs);
            fs.Initialize();
            fs.CreateDirectory("0:\\PROGRAM");
            fs.CreateDirectory("0:\\OS");
            fs.CreateDirectory("0:\\document");
            var    CD = fs.CreateFile("0:\\document\\test.txt");
            var    GD = fs.GetFile("0:\\document\\test.txt");
            string RD = GD.ToString();

            Console.WriteLine(RD);
            //text color
            var textscr = Cosmos.HAL.Global.TextScreen;

            Cosmos.System.Global.Console = new Cosmos.System.Console(textscr);
            Cosmos.HAL.Global.TextScreen = textscr;
            Console.ForegroundColor      = ConsoleColor.Green;
            Console.BackgroundColor      = ConsoleColor.Black;
            //debug
            Kernel.PrintDebug("test");

            //login
E:
            Console.WriteLine("RF OS V 1.0 TERMLINK");
            Console.Write("login user password:"******"admin";
            string inputp   = Console.ReadLine();

            if (inputp == password)
            {
                Console.Clear();
                Run();
            }
            else
            {
                Console.WriteLine("ENTRY DENIED TRY AGAIN");
                Console.WriteLine("press any key to repeat");
                Console.ReadKey();
                Console.Clear();
                goto E;
            }
            if (inputp == "rundebugmode")
            {
                Console.Clear();
                goto A;
            }
            if (inputp == "shutdown")
            {
                Sys.Power.Shutdown();
            }
        }