检查.NET 4.0框架代码
static bool CheckEnvironment()
{
if (Environment.Version < new Version(4, 0, 30319))
{
MessageBox.Show("This version of Applicationrequires .NET 4.0. You are using: " + Environment.Version");
return false;
}
return true;
}