private void Form1_Load(object sender, EventArgs e)
{
if (!IsWin7())
{
Application.Exit();
}
}
bool IsWin7()
{
return Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor == 1;
}
bool IsWinVista()
{
return Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor == 0;
}
others windows versions:
Server 2008 R2
Major=6
Minor=1
Server 2008
Major=6
Minor=0
Server 2003
5
2
XP
5
1
2000
5
0
NT4
4
0
ME
4
90
98
4
10