コード例 #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            ComputerInformation ci = new ComputerInformation();

            currentComputer = new Computer()
            {
                _Name  = ci.GetName(),
                _Ip    = ci.GetIp(),
                _MAC   = ci.GetMACAddress(),
                _Os    = ci.GetOs(),
                Width  = flpServerInfo.Width - 8,
                Height = 90
            };
            flpServerInfo.Controls.Add(currentComputer);

            BackgroundWorker bw = new BackgroundWorker();

            bw.DoWork += (obj, ea) => SetServerInformation();
            bw.RunWorkerAsync();
        }
コード例 #2
0
        private void FillHardware(Computer computer)
        {
            List <string>       view = new List <string>();
            ComputerInformation ci   = new ComputerInformation();

            ci.ScanFromCpuZ();
            computer.AddHardware(ci.GetCpu());
            computer.AddHardware(ci.GetMotherboard());
            foreach (Hardware h in ci.GetGpus())
            {
                computer.AddHardware(h);
            }
            foreach (Hardware h in ci.GetRams())
            {
                computer.AddHardware(h);
            }
            foreach (Hardware h in ci.GetHdds())
            {
                computer.AddHardware(h);
            }
        }