Beispiel #1
0
        private void btnGetId_Click(object sender, EventArgs e)
        {
            GetPCId getpcid = new GetPCId();

            txtRWcontent.Text = "IP地址为:\r\n" + getpcid.StrAddr + "\r\n" + getpcid.GetCPUName() + "\r\n" + getpcid.GetHostName() + "\r\n" + getpcid.GetMemoryInfo() + "\r\n" + getpcid.GetGPUInfo() + "\r\n" + getpcid.GetSolutionInfo();
            this.labInfo.Text = "支持的信息已被读入!";
        }
Beispiel #2
0
        private void ViewRamBarMethod()

        {
            string getTotalRam      = GetTotalRamMethod();
            double getTotalParse    = double.Parse(getTotalRam);
            string getAvailRam      = NewMethod();
            double getAvailRamParse = double.Parse(getAvailRam);
            double usedRAM          = getTotalParse - getAvailRamParse;
            double rate             = 144 / getTotalParse;
            int    usedBar          = (int)(usedRAM * rate);

            btnRamBar.Text = ((usedRAM / getTotalParse) * 100).ToString("0,0") + "%";
            if (((usedRAM / getTotalParse) * 100) >= 80)
            {
                this.btnRamBar.BackColor = Color.Red;
            }
            else
            {
                this.btnRamBar.BackColor = Color.Green;
            }
            //CPU温度
            this.labCPUTem.Text = GetPCId.GetCOUTem();
        }