C#, 윈도우 버전 얻기

 

 

 

 

윈도우 버전 얻기

 

 

Code

 

 

 

 

 

private void frmMain_Load(object sender, EventArgs e)

{

 

OperatingSystem os = Environment.OSVersion;

Version v = os.Version;

 

if (5 == v.Major && v.Minor>0)

{

txtResult.Text += “Windows XP” + “rn”;

}

else if (6 == v.Major && v.Minor == 0)

{

txtResult.Text += “Windows VISTA” + “rn”;

}

else if (6 == v.Major && v.Minor == 1)

{

txtResult.Text += “Windows 7” + “rn”;

}

else

{

txtResult.Text += “그 외 OS” + “rn”;

}

 

txtResult.Text += os.ServicePack + “rn”;

txtResult.Text += “Build : “+v.Build + “rn”;

txtResult.Text += “Revision : ” + v.Revision + “rn”;

 

}

 

 

 

 

 

Result

 

 

 

출처: http://whiteat.com/59066

 

 


Leave a Comment