目录(?)[-]
原文链接:http://blog.csdn.net/kingmax54212008/article/details/25886345
.NET版本 | 1.0 | 1.1 | 2.0 | 3.0 | 3.5 | 4.0 | 4.5 |
完整版本 | 1.0.3705.0 | 1.1.4322.573 | 2.0.50727.42 | 3.0.4506.30 | 3.5.21022.8 | 4.0.30319.1 | 4.5.40805 |
发布时间 | 2002-02-13 | 2003-04-24 | 2005-11-07 | 2006-11-06 | 2007-11-19 | 2010-04-12 | 2012-05-24 |
VS开发版本 | VS2002 | VS2003 | VS2005 | VS2008 | VS2010 | VS2012 | |
Windows默认安装 | Windows Server 2003 | Windows Server 2003 Windows Server 2008 | Windows Vista Windows Server 2008 | Windows 7 Windows Server 2008 R2 | Windows 8 Windows Server 2012 | ||
下载 | .NET Framework 1.0 (SP3) | .NET Framework 1.1 (SP1) | .NET Framework 2.0 (SP2) | .NET Framework 3.0 (SP2) | .NET Framework 3.5 (SP1) | .NET Framework 4.0 | .NET Framework 4.5 |
说明 | Microsoft Internet Explorer 5.01 或更高版本 | Microsoft Internet Explorer 5.01 或更高版本 | Windows Installer 3.1 或更高版本 Internet Explorer 6.0 或更高版本 | 包括 .NET Framework 2.0 Service Pack 2 和 .NET Framework 3.0 Service Pack 2 累积更新 | Windows Installer 3.1 或更高版本 Internet Explorer 5.01 或更高版本 | .NET Framework 4.5 RC 是一个针对 .NET Framework 4 的高度兼容的就地更新。 | |
支持的windows版本 | Windows 98 Windows NT Windows Server 2000 Windows Server 2003 Windows XP | Windows Server 2000 Windows Server 2003 Windows XP | Windows Server 2003 Windows XP | Windows Server 2003 | Windows Server 2003 Windows Server 2008, Windows Vista Windows XP | Windows XP SP3 Windows Server 2003 SP2 Windows Vista SP1 Windows Server 2008 Windows 7 | Windows Vista SP2 Windows 7 Windows 8 Windows Server 2008 Windows Server 2012 |
using System;
using Microsoft.Win32;
public class GetDotNetVersion
{
public static void Main()
{
Console.WriteLine( ".NET框架版本:" );
using (RegistryKey ndpKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, "" ).OpenSubKey( @"SOFTWAREMicrosoftNET Framework SetupNDP" ))
{
foreach ( string versionKeyName in ndpKey.GetSubKeyNames())
{
if (versionKeyName.StartsWith( "v" ))
{
RegistryKey versionKey = ndpKey.OpenSubKey(versionKeyName);
string name = ( string )versionKey.GetValue( "Version" , "" );
string sp = versionKey.GetValue( "SP" , "" ).ToString();
string install = versionKey.GetValue( "Install" , "" ).ToString();
if (install == "" ) //no install info, ust be later
Console.WriteLine(versionKeyName + " " + name);
else
{
if (sp != "" && install == "1" )
{
Console.WriteLine(versionKeyName + " " + name + " SP" + sp);
}
}
if (name != "" )
{
continue ;
}
foreach ( string subKeyName in versionKey.GetSubKeyNames())
{
RegistryKey subKey = versionKey.OpenSubKey(subKeyName);
name = ( string )subKey.GetValue( "Version" , "" );
if (name != "" )
sp = subKey.GetValue( "SP" , "" ).ToString();
install = subKey.GetValue( "Install" , "" ).ToString();
if (install == "" ) //no install info, ust be later
Console.WriteLine(versionKeyName + " " + name);
else
{
if (sp != "" && install == "1" )
{
Console.WriteLine( " " + subKeyName + " " + name + " SP" + sp);
}
else if (install == "1" )
{
Console.WriteLine( " " + subKeyName + " " + name);
}
}
}
}
}
}
Console.WriteLine();
Console.WriteLine( "操作系统版本:" + System.Environment.OSVersion.ToString());
Console.WriteLine( "当前.NET框架版本:" + System.Environment.Version.ToString());
Console.ReadKey();
}
}
|