I want to check what type of operating system i use and what kind of processor. this should be check on run time. i tried using
System.Environment.GetEnvironment
To determine the operating system use this code:
string OPSystemVersion = Environment.OSVersion.ToString();
To determine the CPU name and type first add System.Management reference to your project, then you can use this code:
public static string SendBackProcessorName()
{
ManagementObjectSearcher mosProcessor = new ManagementObjectSearcher("SELECT * FROM Win32_Processor");
string Procname = null;
foreach (ManagementObject moProcessor in mosProcessor.Get())
{
if (moProcessor["name"] != null)
{
Procname = moProcessor["name"].ToString();
}
}
return Procname;
}