/// 获取所有已经安装的程序
/// </summary>
/// <param name="reg"></param>
/// <returns>程序名称,安装路径</returns>
private static List<NameAndPath> GetProgramAndPath()
{
List<NameAndPath> nameAndPaths = new List<NameAndPath>();
var reg = new string[] {
@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",
@"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
};
string tempType = null;
int softNum = 0;//所有已经安装的程序数量
RegistryKey currentKey = null;
foreach (var item222 in reg)
{
object displayName = null, uninstallString = null, installLocation = null, releaseType = null;
RegistryKey pregkey = Registry.LocalMachine.OpenSubK
C# 读取已经安装程序的名称和路径
最新推荐文章于 2023-10-20 16:52:52 发布