3
Answers

How do I show updated versions of OS version, name, etc?

Ask a question
Levi Perry

Levi Perry

8y
331
1
I have this piece of code that returns values for OS information displayed here:
 
Code 
 
//Computer Name
String q1 = System.Environment.MachineName;
metroTextBox1.Text = q1;
//User Name
String q2 = Environment.UserName;
metroTextBox2.Text = Convert.ToString(q2);
//Number of Processors
int q3 = Environment.ProcessorCount;
metroTextBox3.Text = Convert.ToString(q3);
//Operating System
String q4 = System.Environment.OSVersion.Version.ToString();
metroTextBox4.Text = q4;
//OS Platform
String q5 = System.Environment.OSVersion.Platform.ToString();
metroTextBox5.Text = q5;
 
Why does my output display for the last two values:
 
Operating System: 6.2.9200.0
OS Platform = Win32NT 
 
I would like to display a name such as "Windows 8.1" instead of the build number. 
 

Answers (3)