C#读取WinRAR安装路径

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe");
            Console.WriteLine(key.GetValue("").ToString());//GetValue参数值为空时读取默认值

            Console.ReadKey();
        }
    }
}


评论: 0 | 引用: 0 | 查看次数: 4912
发表评论
登录后再发表评论!