Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Diagnostics;
- using System.Threading;
- using System.Management;
- namespace ComputerInformation
- {
- public partial class Form1 : Form
- {
- ManagementObjectSearcher mos =
- new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_Processor");
- ManagementObjectSearcher gpu =
- new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_VideoController");
- ManagementObjectSearcher bios =
- new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_BIOS");
- ManagementObjectSearcher fan =
- new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_Fan");
- ManagementObjectSearcher ram =
- new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_PhysicalMemory");
- ManagementObjectSearcher sound =
- new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_SoundDevice");
- public static string cpuName;
- public static bool cmdCpuName;
- public static string gpuRamS;
- public static int gpuRam;
- public static string gpuRamF;
- public Form1()
- {
- InitializeComponent();
- foreach (ManagementObject mo in mos.Get())
- {
- #region ApplicationInformationText for CPU
- richTextBox1.AppendText(string.Format("{0}", (string)(mo["Name"])));
- richTextBox2.AppendText(string.Format("{0}", (ushort)(mo["Architecture"])));
- richTextBox3.AppendText(string.Format("{0}", mo["NumberOfCores"]).ToString());
- richTextBox4.AppendText(string.Format("{0}", (string)(mo["ProcessorId"])));
- richTextBox5.AppendText(string.Format("{0}", mo["Manufacturer"]).ToString());
- richTextBox6.AppendText(string.Format("{0}", mo["SocketDesignation"]).ToString());
- richTextBox7.AppendText(string.Format("{0}", mo["SystemName"]).ToString());
- #endregion
- }
- foreach (ManagementObject mo in gpu.Get())
- {
- #region ApplicationInformationText for GPU
- richTextBox10.AppendText(string.Format("{0}", (string)(mo["Name"])));
- richTextBox11.AppendText(string.Format("{0}", mo["CurrentRefreshRate"]).ToString());
- richTextBox12.AppendText(string.Format("{0}", mo["CurrentHorizontalResolution"]).ToString());
- richTextBox13.AppendText(string.Format("{0}", mo["CurrentVerticalResolution"]).ToString());
- richTextBox14.AppendText(string.Format("{0}", (string)(mo["DriverVersion"])));
- richTextBox15.AppendText(string.Format("{0}", mo["MaxRefreshRate"]).ToString());
- #endregion
- }
- foreach (ManagementObject mo in bios.Get())
- {
- #region ApplicationInformationText for BIOS
- #endregion
- }
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- }
- private void richTextBox1_TextChanged(object sender, EventArgs e)
- {
- }
- private void textBox1_TextChanged_1(object sender, EventArgs e)
- {
- }
- //Arc...
- private void button1_Click(object sender, EventArgs e)
- {
- MessageBox.Show("0 = x86 Platform" + "\n" + "1 = MIPS" + "\n" + "5 = ARM" + "\n" + "9 = x64 Platform", "Architecture Code Debug");
- }
- //Cores
- private void button2_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Most likely this is the case:" + "\n" + "2 Cores = Dual Core CPU" + "\n" + "4 Cores = Quad Core CPU" + "\n" + "6 Cores = Hex CPU", "Information for Cores");
- }
- //Company
- private void button3_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Company Names can be:" + "\n" + "GenuineIntel = Intel" + "\n" + "AMD = AMD", "Company CPU Name");
- }
- private void richTextBox3_TextChanged(object sender, EventArgs e)
- {
- }
- // Socket Des
- private void button4_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Sockets:" + "\n" + "0 = 1 CPU" + "\n" + "1 = 2 CPU's", "Socket Designation");
- }
- //Information box for displaying from commands wrote into the console below...
- private void richTextBox9_TextChanged(object sender, EventArgs e)
- {
- }
- //Console for advance information on computer information...
- private void richTextBox8_TextChanged(object sender, EventArgs e)
- {
- //Custom Commands in my Console...
- #region List of Commands if you write cmds
- if (richTextBox8.Text == "cmds")
- {
- richTextBox8.Clear();
- richTextBox9.Clear();
- richTextBox9.AppendText("Commands for the Console:"
- + "\n"
- + "\n"
- + "biosinfo, cpucores, cpuname, cputype, faninfo, gpudriver, gpuname, gpurefresh, family, logicalcores, raminfo, resolution, soundinfo, sysname"
- + "\n"
- + "\n"
- + "You can also find information on these commands writing: help. infront of the command, example: help.cpuname");
- }
- #endregion
- if (richTextBox8.Text == "clear")
- {
- richTextBox8.Clear();
- richTextBox9.Clear();
- }
- #region CPU Commands
- #region CPUName
- if (richTextBox8.Text == "cpuname")
- {
- foreach (ManagementObject mo in mos.Get())
- {
- richTextBox8.Clear();
- richTextBox9.Clear();
- richTextBox9.AppendText(string.Format("{0}", (string)(mo["Name"])));
- }
- }
- if (richTextBox8.Text == "help.cpuname")
- {
- richTextBox9.Clear();
- richTextBox9.AppendText("cpuname: This command shows you the CPU company name, model and default speed.");
- richTextBox8.Clear();
- }
- #endregion
- #region SystemName
- if (richTextBox8.Text == "sysname")
- {
- foreach (ManagementObject mo in mos.Get())
- {
- richTextBox8.Clear();
- richTextBox9.Clear();
- richTextBox9.AppendText(string.Format("{0}", mo["SystemName"]).ToString());
- }
- }
- if (richTextBox8.Text == "help.sysname")
- {
- richTextBox9.Clear();
- richTextBox9.AppendText("sysname: This command shows you the Name of the current SYSTEM this application is running on.");
- richTextBox8.Clear();
- }
- #endregion
- #region Family
- if (richTextBox8.Text == "family")
- {
- foreach (ManagementObject mo in mos.Get())
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText(string.Format("Family : {0}", (ushort)mo["Family"]));
- }
- }
- if (richTextBox8.Text == "help.family")
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText("family: This command shows you the Processor family type, values mean:"
- + "\n"
- + "\n"
- + "1 = Other"
- + "\n"
- + "2 = Unknown"
- + "\n"
- + "13 = Pentium"
- + "\n"
- + "15 = Celeron"
- + "\n"
- + "\n"
- + "Visit http://msdn.microsoft.com/en-us/library/aa394373(VS.85).aspx for a better understanding");
- }
- #endregion
- #region Cores
- if (richTextBox8.Text == "cpucores")
- {
- foreach (ManagementObject mo in mos.Get())
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText(string.Format("NumberOfCores : {0}", mo["NumberOfCores"]).ToString());
- }
- }
- if (richTextBox8.Text == "help.cpucores")
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText("cpucores: This command shows you the ammount of Cores for the current processor, physical cores not logic (Hyperthreading won't count).");
- }
- #endregion Cores
- #region Logical Cores
- if (richTextBox8.Text == "logicalcores")
- {
- foreach (ManagementObject mo in mos.Get())
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText(string.Format("NumberOfLogicalProcessors : {0}", mo["NumberOfLogicalProcessors"]).ToString());
- }
- }
- if (richTextBox8.Text == "help.logicalcores")
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText("logicalcores: This command shows you the Number of logical processors for the current instance of the processor, this includes Threads for HyperThreading technology.");
- }
- #endregion
- #region CPU Type
- if (richTextBox8.Text == "cputype")
- {
- foreach (ManagementObject mo in mos.Get())
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText(string.Format("ProcessorType : {0}", (ushort)mo["ProcessorType"]));
- }
- }
- if (richTextBox8.Text == "help.cputype")
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText("cputype: This command shows you the Primary function of the processor in your motherboard, values include:"
- + "\n"
- + "\n"
- + "1 = Other"
- + "3 = Central Processor"
- + "4 = Math Processor"
- + "5 = DSP Processor"
- + "6 = Video Processor");
- }
- #endregion
- #endregion
- #region GPU Commands
- #region GPUName
- if (richTextBox8.Text == "gpuname")
- {
- foreach (ManagementObject mo in gpu.Get())
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText(string.Format("{0}", (string)(mo["Name"])));
- }
- }
- if (richTextBox8.Text == "help.gpuname")
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText("gpuname: This command shows you the GPU company and model");
- }
- #endregion
- #region GPUDriver
- if (richTextBox8.Text == "gpudriver")
- {
- foreach (ManagementObject mo in gpu.Get())
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText(string.Format("{0}", (string)(mo["DriverVersion"])));
- }
- }
- if (richTextBox8.Text == "help.gpudriver")
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText("gpuname: This command shows you the GPU driver details");
- }
- #endregion
- #region GPU RF rate
- if (richTextBox8.Text == "gpurefresh")
- {
- foreach (ManagementObject mo in gpu.Get())
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText("Current Refresh Rate: " + string.Format("{0}", mo["CurrentRefreshRate"]).ToString());
- richTextBox9.AppendText("\n" + "Max Refresh Rate: " + string.Format("{0}", mo["MaxRefreshRate"]).ToString());
- }
- }
- if (richTextBox8.Text == "help.gpurefresh")
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText("gpurefresh: This command shows you the GPU refresh rate which it is currently running at.");
- }
- #endregion
- #region Resolution
- if (richTextBox8.Text == "resolution")
- {
- foreach (ManagementObject mo in gpu.Get())
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText(string.Format("{0}", mo["CurrentHorizontalResolution"]).ToString());
- richTextBox9.AppendText(" x ");
- richTextBox9.AppendText(string.Format("{0}", mo["CurrentVerticalResolution"]).ToString());
- if (richTextBox9.Text == "3840 x 2160")
- {
- richTextBox9.AppendText(" = 2160p (aka 4k)");
- }
- if (richTextBox9.Text == "2560 x 1440")
- {
- richTextBox9.AppendText(" = 1440p (aka 2k)");
- }
- if (richTextBox9.Text == "1920 x 1080")
- {
- richTextBox9.AppendText(" - 1080p");
- }
- if (richTextBox9.Text == "1280 x 720")
- {
- richTextBox9.AppendText(" - 720p");
- }
- if (richTextBox9.Text == "640 × 480")
- {
- richTextBox9.AppendText(" - Damnnn! It's 2014, you need to upgrade soon!");
- }
- }
- }
- if (richTextBox8.Text == "help.resolution")
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText("resolution: This command shows you the Resolution your card is outputting on your monitor."
- + "\n"
- + "\n"
- + "Common Resolutions:"
- + "\n"
- + "640 x 480 = 480p"
- + "\n"
- + "1280 x 720 = 720p"
- + "\n"
- + "1920 x 1080 = 1080p (aka Full HD)"
- + "\n"
- + "2560 x 1440 = 1440p (aka 2k)"
- + "\n"
- + "3840 x 2160 = 2160p (aka 4K aka big lad/lass resolution");
- }
- #endregion
- #endregion
- #region BIOS Commands
- if (richTextBox8.Text == "biosinfo")
- {
- foreach (ManagementObject mo in bios.Get())
- {
- richTextBox8.Clear();
- richTextBox9.Clear();
- richTextBox9.AppendText(string.Format("Version: {0}", (string)(mo["Version"])) + "\n");
- richTextBox9.AppendText(string.Format("Manufacturer: {0}", (string)(mo["Manufacturer"])) + "\n" + "\n");
- richTextBox9.AppendText(string.Format("{0}", (string)(mo["Name"])) + "\n" + "Serial Number: " +(mo["SerialNumber"]));
- }
- }
- if (richTextBox8.Text == "help.biosinfo")
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText("biosinfo: This command shows you some information about the Bios itself.");
- }
- #endregion
- #region FAN Commands
- if (richTextBox8.Text == "faninfo")
- {
- foreach (ManagementObject mo in fan.Get())
- {
- richTextBox8.Clear();
- richTextBox9.Clear();
- richTextBox9.AppendText(string.Format("Description: {0}", (string)(mo["Description"])) + "\n");
- richTextBox9.AppendText(string.Format("Name: {0}", (string)(mo["Name"])) + "\n" + "Active: " + mo["ActiveCooling"] + "\n");
- richTextBox9.AppendText(string.Format("Availability: {0}", mo["Availability"]).ToString() + "\n" + "1 = Other, 3 = Running/Full, 4 = Warning, 7 = Power Off");
- }
- }
- if (richTextBox8.Text == "help.faninfo")
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText("faninfo: This command shows you some information about the Fan on your CPU cooler.");
- }
- #endregion
- #region RAM Commands
- if (richTextBox8.Text == "raminfo")
- {
- foreach (ManagementObject mo in ram.Get())
- {
- richTextBox8.Clear();
- richTextBox9.Clear();
- richTextBox9.AppendText(string.Format("Description: {0}", (string)(mo["Description"])) + "\n" + "Manufacturer: " + (mo["Manufacturer"]) + "\n" + "Model: " + (mo["Model"]) + "\n");
- richTextBox9.AppendText(string.Format("Speed: {0}", mo["Speed"]).ToString() + "mhz");
- }
- }
- if (richTextBox8.Text == "help.raminfo")
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText("raminfo: This command shows you some information about the RAM installed in your system.");
- }
- #endregion
- #region SOUND Commands
- if (richTextBox8.Text == "soundinfo")
- {
- foreach (ManagementObject mo in sound.Get())
- {
- richTextBox8.Clear();
- richTextBox9.Clear();
- richTextBox9.AppendText(string.Format("Description: {0}", (string)(mo["Description"])) + "\n" + "Manufacturer: " + (mo["Manufacturer"]) + "\n" + "ProductName: " + (mo["ProductName"]) + "\n");
- }
- }
- if (richTextBox8.Text == "help.soundinfo")
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- richTextBox9.AppendText("soundinfo: This command shows you some information about the Sound Device on your motherboard, if a GPU is installed, it may recognize the audio from it.");
- }
- #endregion
- }
- private void button6_Click(object sender, EventArgs e)
- {
- richTextBox9.Clear();
- richTextBox8.Clear();
- }
- private void button5_Click(object sender, EventArgs e)
- {
- richTextBox8.Clear();
- }
- private void richTextBox10_TextChanged(object sender, EventArgs e)
- {
- }
- private void richTextBox12_TextChanged(object sender, EventArgs e)
- {
- }
- // Hor and Vertical Sizes
- private void button7_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Resolutions" + "\n" + "1920x1080 = 1080P" + "\n" + "1280 x 720 = 720p", "Resolution of Screen");
- }
- // Refresh Rate
- private void button8_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Refresh Rate:" + "\n" + "Normally your Video card is running the same as the Refresh rate as your Monitor" + "\n" + "Refresh rate is measured in Hz", "Refresh Rate");
- }
- // Max Refresh Rate
- private void button9_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Max Refresh Rate:" + "\n" + "means the MAX hz the Video card can push through to your monitor", "Max Refresh Rate");
- }
- private void richTextBox16_TextChanged(object sender, EventArgs e)
- {
- }
- private void button10_Click(object sender, EventArgs e)
- {
- }
- private void textBox1_TextChanged_2(object sender, EventArgs e)
- {
- }
- private void textBox1_TextChanged_3(object sender, EventArgs e)
- {
- }
- private void button10_Click_1(object sender, EventArgs e)
- {
- }
- private void richTextBox16_TextChanged_1(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement