/// <summary>
        /// Start Aura after login.
        /// </summary>
        private static void Start(string username)
        {
            Console.Clear();

            Kernel.SystemExists  = true;
            Kernel.userLogged    = username;
            Kernel.JustInstalled = true;
            Kernel.running       = true;

            Console.Clear();

            Utils.Settings config = new Utils.Settings(@"0:\System\settings.conf");

            string debugger = config.GetValue("debugger");

            if (debugger == "on")
            {
                Kernel.debugger.enabled = true;
            }

            NetworkInit.Enable();

            WelcomeMessage.Display();
            Text.Display("logged", username);

            Console.WriteLine();

            Kernel.Logged = true;
        }
        /// <summary>
        /// CommandIPConfig without args
        /// </summary>
        public override ReturnInfo Execute()
        {
            if (NetworkStack.ConfigEmpty())
            {
                Console.WriteLine("No network configuration detected! Use ipconfig /help");
            }
            foreach (HAL.Drivers.Network.NetworkDevice device in NetworkConfig.Keys)
            {
                switch (device.CardType)
                {
                case HAL.Drivers.Network.CardType.Ethernet:
                    Console.WriteLine("Ethernet Card : " + device.NameID + " - " + device.Name);
                    break;

                case HAL.Drivers.Network.CardType.Wireless:
                    Console.WriteLine("Wireless Card : " + device.NameID + " - " + device.Name);
                    break;
                }
                Utils.Settings settings = new Utils.Settings(@"0:\System\" + device.Name + ".conf");
                Console.WriteLine("MAC Address          : " + device.MACAddress.ToString());
                Console.WriteLine("IP Address           : " + NetworkConfig.Get(device).IPAddress.ToString());
                Console.WriteLine("Subnet mask          : " + NetworkConfig.Get(device).SubnetMask.ToString());
                Console.WriteLine("Default Gateway      : " + NetworkConfig.Get(device).DefaultGateway.ToString());
                Console.WriteLine("Preferred DNS server : " + settings.GetValue("dns01"));
            }

            return(new ReturnInfo(this, ReturnCode.OK));
        }
示例#3
0
        /// <summary>
        /// Display IP Configuration and MAC Address
        /// </summary>
        public static void Ipconfig()
        {
            switch (Uszka.Kernel.langSelected)
            {
            case "fr_FR":
                int counter = 0;
                foreach (HAL.Drivers.Network.NetworkDevice device in NetworkConfig.Keys)
                {
                    switch (device.CardType)
                    {
                    case HAL.Drivers.Network.CardType.Ethernet:
                        Console.WriteLine("Carte Ethernet " + counter + " - " + device.Name);
                        break;

                    case HAL.Drivers.Network.CardType.Wireless:
                        Console.WriteLine("Carte réseau sans fil " + counter + " :");
                        break;
                    }
                    Utils.Settings settings = new Utils.Settings(@"0:\System\" + device.Name + ".conf");
                    Console.WriteLine("Adresse MAC           : " + device.MACAddress.ToString());
                    Console.WriteLine("Adresse IP            : " + settings.GetValue("ipaddress"));
                    Console.WriteLine("Masque de sous-réseau : " + settings.GetValue("subnet"));
                    Console.WriteLine("Passerelle par défaut : " + settings.GetValue("gateway"));
                    Console.WriteLine("Serveur DNS préféré   : " + settings.GetValue("dns01"));
                    counter++;
                }
                counter = 0;
                break;

            case "en_US":
                int counter1 = 0;
                foreach (HAL.Drivers.Network.NetworkDevice device in NetworkConfig.Keys)
                {
                    switch (device.CardType)
                    {
                    case HAL.Drivers.Network.CardType.Ethernet:
                        Console.WriteLine("Ethernet Card  " + counter1 + " - " + device.Name);
                        break;

                    case HAL.Drivers.Network.CardType.Wireless:
                        Console.WriteLine("Wireless Card " + counter1 + " - " + device.Name);
                        break;
                    }
                    Utils.Settings settings = new Utils.Settings(@"0:\System\" + device.Name + ".conf");
                    Console.WriteLine("MAC Address          : " + device.MACAddress.ToString());
                    Console.WriteLine("IP Address           : " + settings.GetValue("ipaddress"));
                    Console.WriteLine("Subnet mask          : " + settings.GetValue("subnet"));
                    Console.WriteLine("Default Gateway      : " + settings.GetValue("gateway"));
                    Console.WriteLine("Preferred DNS server : " + settings.GetValue("dns01"));
                    counter1++;
                }
                counter1 = 0;
                break;

            case "nl_NL":
                int counter2 = 0;
                foreach (HAL.Drivers.Network.NetworkDevice device in NetworkConfig.Keys)
                {
                    switch (device.CardType)
                    {
                    case HAL.Drivers.Network.CardType.Ethernet:
                        Console.WriteLine("Ethernetkaart " + counter2 + " - " + device.Name);
                        break;

                    case HAL.Drivers.Network.CardType.Wireless:
                        Console.WriteLine("Draadloze Netwerkkaart " + counter2 + " :");
                        break;
                    }
                    Utils.Settings settings = new Utils.Settings(@"0:\System\" + device.Name + ".conf");
                    Console.WriteLine("MAC-adres           : " + device.MACAddress.ToString());
                    Console.WriteLine("IP-adres            : " + settings.GetValue("ipaddress"));
                    Console.WriteLine("Subnetmasker        : " + settings.GetValue("subnet"));
                    Console.WriteLine("Standaardgateway    : " + settings.GetValue("gateway"));
                    Console.WriteLine("Voorkeur DNS-server : " + settings.GetValue("dns01"));
                    counter2++;
                }
                counter2 = 0;
                break;

            case "it_IT":
                int counter3 = 0;
                foreach (HAL.Drivers.Network.NetworkDevice device in NetworkConfig.Keys)
                {
                    switch (device.CardType)
                    {
                    case HAL.Drivers.Network.CardType.Ethernet:
                        Console.WriteLine("Scheda Ethernet " + counter3 + " - " + device.Name);
                        break;

                    case HAL.Drivers.Network.CardType.Wireless:
                        Console.WriteLine("Scheda di rete senza fili " + counter3 + " :");
                        break;
                    }
                    Utils.Settings settings = new Utils.Settings(@"0:\System\" + device.Name + ".conf");
                    Console.WriteLine("Indirizzo MAC         : " + device.MACAddress.ToString());
                    Console.WriteLine("Indirizzo IP          : " + settings.GetValue("ipaddress"));
                    Console.WriteLine("Maschera di sottorete : " + settings.GetValue("subnet"));
                    Console.WriteLine("Gateway predefinito   : " + settings.GetValue("gateway"));
                    Console.WriteLine("Server DNS preferito  : " + settings.GetValue("dns01"));
                    counter3++;
                }
                counter3 = 0;
                break;
            }
        }
示例#4
0
        /// <summary>
        /// Display help on settings commands.
        /// </summary>
        public static void Systeminfo()
        {
            Utils.Settings config = new Utils.Settings(@"0:\System\settings.conf");
            switch (Uszka.Kernel.langSelected)
            {
            case "fr_FR":
                Console.WriteLine("Nom du PC:                     " + Uszka.Kernel.ComputerName);
                Console.WriteLine("Nom du système d'exploitation: Aura");
                Console.WriteLine("Version du système:            " + Uszka.Kernel.version);
                Console.WriteLine("Révision du système:           " + Uszka.Kernel.revision);
                Console.WriteLine("Date et heure:                 " + Time.MonthString() + "/" + Time.DayString() + "/" + Time.YearString() + ", " + Time.TimeString(true, true, true));
                if (Uszka.Kernel.SystemExists)
                {
                    Console.WriteLine("Date d'installation originale: " + config.GetValue("setuptime"));
                }
                Console.WriteLine("Mémoire totale:                " + Core.MemoryManager.TotalMemory + "MB");
                Console.WriteLine("Mémoire utilisée:              " + Core.MemoryManager.GetUsedMemory() + "MB");
                Console.WriteLine("Mémoire restante:              " + Core.MemoryManager.GetFreeMemory() + "MB");

                /*Console.WriteLine("Processeur(s):                 " + Computer.Info.GetNumberOfCPU() + " processeur(s) installé(s).");
                 * int i = 1;
                 * foreach (Processor processor in Computer.CPUInfo.Processors)
                 * {
                 *  Console.WriteLine("[" + i + "] : " + processor.GetBrandName() + (int)processor.Frequency + " Mhz");
                 *  i++;
                 * }
                 * Computer.CPUInfo.Processors.Clear();*/
                Console.WriteLine("Mode de la console:            " + Uszka.Kernel.AConsole.Name);
                break;

            case "en_US":
                Console.WriteLine("Computer name:             " + Uszka.Kernel.ComputerName);
                Console.WriteLine("Operating system name:     Aura");
                Console.WriteLine("Operating system version:  " + Uszka.Kernel.version);
                Console.WriteLine("Operating system revision: " + Uszka.Kernel.revision);
                Console.WriteLine("Date and time:             " + Time.MonthString() + "/" + Time.DayString() + "/" + Time.YearString() + ", " + Time.TimeString(true, true, true));
                if (Uszka.Kernel.SystemExists)
                {
                    Console.WriteLine("Original Install Date:     " + config.GetValue("setuptime"));
                }
                Console.WriteLine("Total memory:              " + Core.MemoryManager.TotalMemory + "MB");
                Console.WriteLine("Used memory:               " + Core.MemoryManager.GetUsedMemory() + "MB");
                Console.WriteLine("Free memory:               " + Core.MemoryManager.GetFreeMemory() + "MB");

                /*Console.WriteLine("Processor(s):              " + Computer.Info.GetNumberOfCPU() + " installed processor(s).");
                 * int j = 1;
                 * foreach (Processor processor in Computer.CPUInfo.Processors)
                 * {
                 *  Console.WriteLine("[" + j + "] : " + processor.GetBrandName() + (int)processor.Frequency + " Mhz");
                 *  j++;
                 * }
                 * Computer.CPUInfo.Processors.Clear();*/
                Console.WriteLine("Console mode:              " + Uszka.Kernel.AConsole.Name);
                break;

            case "nl_NL":
                Console.WriteLine("Naam computer:             " + Uszka.Kernel.ComputerName);
                Console.WriteLine("Naam besturingssysteem:    Aura");
                Console.WriteLine("Versie besturingssysteem:  " + Uszka.Kernel.version);
                Console.WriteLine("Revisie besturingssysteem: " + Uszka.Kernel.revision);
                Console.WriteLine("Datum en tijd:             " + Time.MonthString() + "/" + Time.DayString() + "/" + Time.YearString() + ", " + Time.TimeString(true, true, true));
                if (Uszka.Kernel.SystemExists)
                {
                    Console.WriteLine("Installeer datum:          " + config.GetValue("setuptime"));
                }
                Console.WriteLine("Totaal geheugen:           " + Core.MemoryManager.TotalMemory + "MB");
                Console.WriteLine("Gebruikt geheugen:         " + Core.MemoryManager.GetUsedMemory() + "MB");
                Console.WriteLine("Gratis geheugen:           " + Core.MemoryManager.GetFreeMemory() + "MB");

                /*Console.WriteLine("Processor(s):              " + Computer.Info.GetNumberOfCPU() + " processor(s) geïnstalleerd.");
                 * int k = 1;
                 * foreach (Processor processor in Computer.CPUInfo.Processors)
                 * {
                 *  Console.WriteLine("[" + k + "] : " + processor.GetBrandName() + (int)processor.Frequency + " Mhz");
                 *  k++;
                 * }
                 * Computer.CPUInfo.Processors.Clear();*/
                Console.WriteLine("Consolewijze:              " + Uszka.Kernel.AConsole.Name);
                break;

            case "it_IT":
                Console.WriteLine("Nome del computer:               " + Uszka.Kernel.ComputerName);
                Console.WriteLine("Nome del sistema operativo:      Aura");
                Console.WriteLine("Versione del sistema operativo:  " + Uszka.Kernel.version);
                Console.WriteLine("Revisione del sistema operativo: " + Uszka.Kernel.revision);
                Console.WriteLine("Data e ora:                      " + Time.MonthString() + "/" + Time.DayString() + "/" + Time.YearString() + ", " + Time.TimeString(true, true, true));
                if (Uszka.Kernel.SystemExists)
                {
                    Console.WriteLine("Data Installazione Sistema:      " + config.GetValue("setuptime"));
                }
                Console.WriteLine("Memoria totale:                  " + Core.MemoryManager.TotalMemory + "MB");
                Console.WriteLine("Memoria utilizzata:              " + Core.MemoryManager.GetUsedMemory() + "MB");
                Console.WriteLine("Memoria libera:                  " + Core.MemoryManager.GetFreeMemory() + "MB");

                /*Console.WriteLine("Processor(s):                    " + Computer.Info.GetNumberOfCPU() + " installed processor(s).");
                 * int h = 1;
                 * foreach (Processor processor in Computer.CPUInfo.Processors)
                 * {
                 *  Console.WriteLine("[" + h + "] : " + processor.GetBrandName() + (int)processor.Frequency + " Mhz");
                 *  h++;
                 * }
                 * Computer.CPUInfo.Processors.Clear();*/
                break;
            }
        }
        /// <summary>
        /// Display IP Configuration and MAC Address
        /// </summary>
        public static void Ipconfig()
        {
            switch (Kernel.langSelected)
            {
            case "fr_FR":
                int counter = 0;
                if (NetworkStack.ConfigEmpty())
                {
                    Console.WriteLine("Aucune configuration réseau détectée! Utilisez ipconfig /help");
                }
                foreach (HAL.Drivers.Network.NetworkDevice device in NetworkConfig.Keys)
                {
                    switch (device.CardType)
                    {
                    case HAL.Drivers.Network.CardType.Ethernet:
                        Console.WriteLine("Carte Ethernet " + counter + " - " + device.Name);
                        break;

                    case HAL.Drivers.Network.CardType.Wireless:
                        Console.WriteLine("Carte réseau sans fil " + counter + " :");
                        break;
                    }
                    Utils.Settings settings = new Utils.Settings(@"0:\System\" + device.Name + ".conf");
                    Console.WriteLine("Adresse MAC           : " + device.MACAddress.ToString());
                    Console.WriteLine("Adresse IP            : " + NetworkConfig.Get(device).IPAddress.ToString());
                    Console.WriteLine("Masque de sous-réseau : " + NetworkConfig.Get(device).SubnetMask.ToString());
                    Console.WriteLine("Passerelle par défaut : " + NetworkConfig.Get(device).DefaultGateway.ToString());
                    Console.WriteLine("Serveur DNS préféré   : " + settings.GetValue("dns01"));
                    counter++;
                }
                break;

            case "en_US":
                int counter1 = 0;
                if (NetworkStack.ConfigEmpty())
                {
                    Console.WriteLine("No network configuration detected! Use ipconfig /help");
                }
                foreach (HAL.Drivers.Network.NetworkDevice device in NetworkConfig.Keys)
                {
                    switch (device.CardType)
                    {
                    case HAL.Drivers.Network.CardType.Ethernet:
                        Console.WriteLine("Ethernet Card  " + counter1 + " - " + device.Name);
                        break;

                    case HAL.Drivers.Network.CardType.Wireless:
                        Console.WriteLine("Wireless Card " + counter1 + " - " + device.Name);
                        break;
                    }
                    Utils.Settings settings = new Utils.Settings(@"0:\System\" + device.Name + ".conf");
                    Console.WriteLine("MAC Address          : " + device.MACAddress.ToString());
                    Console.WriteLine("IP Address           : " + NetworkConfig.Get(device).IPAddress.ToString());
                    Console.WriteLine("Subnet mask          : " + NetworkConfig.Get(device).SubnetMask.ToString());
                    Console.WriteLine("Default Gateway      : " + NetworkConfig.Get(device).DefaultGateway.ToString());
                    Console.WriteLine("Preferred DNS server : " + settings.GetValue("dns01"));
                    counter1++;
                }
                break;

            case "nl_NL":
                int counter2 = 0;
                if (NetworkStack.ConfigEmpty())
                {
                    Console.WriteLine("Geen netwerkconfiguratie gedetecteerd! Gebruik ipconfig /help");
                }
                foreach (HAL.Drivers.Network.NetworkDevice device in NetworkConfig.Keys)
                {
                    switch (device.CardType)
                    {
                    case HAL.Drivers.Network.CardType.Ethernet:
                        Console.WriteLine("Ethernetkaart " + counter2 + " - " + device.Name);
                        break;

                    case HAL.Drivers.Network.CardType.Wireless:
                        Console.WriteLine("Draadloze Netwerkkaart " + counter2 + " :");
                        break;
                    }
                    Utils.Settings settings = new Utils.Settings(@"0:\System\" + device.Name + ".conf");
                    Console.WriteLine("MAC-adres           : " + device.MACAddress.ToString());
                    Console.WriteLine("IP-adres            : " + NetworkConfig.Get(device).IPAddress.ToString());
                    Console.WriteLine("Subnetmasker        : " + NetworkConfig.Get(device).SubnetMask.ToString());
                    Console.WriteLine("Standaardgateway    : " + NetworkConfig.Get(device).DefaultGateway.ToString());
                    Console.WriteLine("Voorkeur DNS-server : " + settings.GetValue("dns01"));
                    counter2++;
                }
                break;

            case "it_IT":
                int counter3 = 0;
                if (NetworkStack.ConfigEmpty())
                {
                    Console.WriteLine("Nessuna configurazione di rete rilevata! Utilizzare ipconfig /help");
                }
                foreach (HAL.Drivers.Network.NetworkDevice device in NetworkConfig.Keys)
                {
                    switch (device.CardType)
                    {
                    case HAL.Drivers.Network.CardType.Ethernet:
                        Console.WriteLine("Scheda Ethernet " + counter3 + " - " + device.Name);
                        break;

                    case HAL.Drivers.Network.CardType.Wireless:
                        Console.WriteLine("Scheda di rete senza fili " + counter3 + " :");
                        break;
                    }
                    Utils.Settings settings = new Utils.Settings(@"0:\System\" + device.Name + ".conf");
                    Console.WriteLine("Indirizzo MAC         : " + device.MACAddress.ToString());
                    Console.WriteLine("Indirizzo IP          : " + NetworkConfig.Get(device).IPAddress.ToString());
                    Console.WriteLine("Maschera di sottorete : " + NetworkConfig.Get(device).SubnetMask.ToString());
                    Console.WriteLine("Gateway predefinito   : " + NetworkConfig.Get(device).DefaultGateway.ToString());
                    Console.WriteLine("Server DNS preferito  : " + settings.GetValue("dns01"));
                    counter3++;
                }
                break;

            case "pl_PL":
                int counter4 = 0;
                if (NetworkStack.ConfigEmpty())
                {
                    Console.WriteLine("Nie wykryto zadnej konfiguracji sieci! Uzyj ipconfig /help");
                }
                foreach (HAL.Drivers.Network.NetworkDevice device in NetworkConfig.Keys)
                {
                    switch (device.CardType)
                    {
                    case HAL.Drivers.Network.CardType.Ethernet:
                        Console.WriteLine("Karta Sieciowa  " + counter4 + " - " + device.Name);
                        break;

                    case HAL.Drivers.Network.CardType.Wireless:
                        Console.WriteLine("Karta bezprzewodowa " + counter4 + " - " + device.Name);
                        break;
                    }
                    Utils.Settings settings = new Utils.Settings(@"0:\System\" + device.Name + ".conf");
                    Console.WriteLine("Adres MAC              : " + device.MACAddress.ToString());
                    Console.WriteLine("Adres IP               : " + NetworkConfig.Get(device).IPAddress.ToString());
                    Console.WriteLine("Maska sieciowa         : " + NetworkConfig.Get(device).SubnetMask.ToString());
                    Console.WriteLine("Brama sieciowa         : " + NetworkConfig.Get(device).DefaultGateway.ToString());
                    Console.WriteLine("Preferowany serwer DNS : " + settings.GetValue("dns01"));
                    counter4++;
                }
                break;
            }
        }
示例#6
0
 /// <summary>
 /// Get the IP address of the DHCP server
 /// </summary>
 /// <returns></returns>
 public static Address DHCPServerAddress(NetworkDevice networkDevice)
 {
     Utils.Settings settings = new Utils.Settings(@"0:\System\" + networkDevice.Name + ".conf");
     return(Address.Parse(settings.GetValue("dhcp_server")));
 }