/**/ /// <summary> /// 获取.net版本 /// </summary> /// <returns></returns> public string [] GetDotNetVersions() ... { DirectoryInfo[] directories = new DirectoryInfo(Environment.SystemDirectory + @"..Microsoft.NETFramework").GetDirectories("v?.?.*"); ArrayList list = new ArrayList(); foreach (DirectoryInfo info2 in directories) ...{ list.Add(info2.Name.Substring(1)); } return (list.ToArray(typeof(string)) as string[]); }