C# 윈도우 버전 프로그램 어때요?
2015.08.12 15:59
string str = OSInfo.Name();
bool findClientOS10 = str.Contains("Windows 10");
bool findClientOS8_1 = str.Contains("Windows 8.1");
bool findClientOS8 = str.Contains("Windows 8");
bool findClientOS7 = str.Contains("Windows 7");
bool findClientOSvista = str.Contains("Windows Vista");
bool findClientOSxp = str.Contains("Windows XP");
bool findServerOS2016 = str.Contains("Windows Server 2016");
bool findServerOS2012 = str.Contains("Windows Server 2012");
bool findServerOS2003 = str.Contains("Windows Server 2003");
ResourceManager rm = Properties.Resources.ResourceManager;
Bitmap windows2016 = (Bitmap)rm.GetObject("Windows_Server_2016_Logo");
Bitmap windows10 = (Bitmap)rm.GetObject("Windows_10_Logo");
Bitmap windows2012 = (Bitmap)rm.GetObject("Windows_Server_2012_Logo");
Bitmap windows8 = (Bitmap)rm.GetObject("Windows_8_Logo");
Bitmap windows7 = (Bitmap)rm.GetObject("Windows_7_Logo");
Bitmap windowsvista = (Bitmap)rm.GetObject("Windows_Vista_Logo");
Bitmap windows2003 = (Bitmap)rm.GetObject("Windows_Server_2003_Logo");
Bitmap windowsxp = (Bitmap)rm.GetObject("Windows_XP_Logo");
if (findServerOS2016 == true)
{
pictureBox1.Image = windows2016;
}
else if (findClientOS10 == true)
{
pictureBox1.Image = windows10;
}
else if (findServerOS2012 == true)
{
pictureBox1.Image = windows2012;
}
else if(findClientOS8_1 == true || findClientOS8 == true)
{
pictureBox1.Image = windows8;
}
else if (findClientOS7 == true)
{
pictureBox1.Image = windows7;
}
else if (findClientOSvista == true)
{
pictureBox1.Image = windowsvista;
}
else if (findServerOS2003 == true)
{
pictureBox1.Image = windows2003;
}
else if (findClientOSxp == true)
{
pictureBox1.Image = windowsxp;
}
좋아요.. 간단하게 정보확인용으로 좋네요.. ^^
소스도 풀어주시고.. 참고하겠습니다.