/// <summary>
/// 获取已安装的所有NET版本
/// </summary>
/// <returns></returns>
public static List<string> GetDotNetVersions()
{
var filepath =Environment.SystemDirectory + @"\..\Microsoft.NET\Framework";
DirectoryInfo[] directories = new DirectoryInfo(filepath).GetDirectories("v?.?.*");
List<string> list = new List<string>();
foreach (DirectoryInfo info in directories)
{
list.Add(info.Name.Substring());
}
return list;
}
04-19 12:52