阅读在C#中的注册表项 [英] Reading a registry key in C#
本文介绍了阅读在C#中的注册表项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已开发的应用程序,并安装了它的客户端计算机上。在我的应用程序需要得到它的安装路径。我的应用程序有一个注册表项为:
I have developed an application and installed it on a client computer. In my application I need to get its installation path. My application has a registry entry at:
HKEY_LOCAL_MACHINE\SOFTWARE\MyApplication\[AppPath]
我怎么能读 APPPATH
使用C#?
推荐答案
看到这样的http://www.$c$cproject.com/Articles/3389/Read-write-and-delete-from-registry-with-C
更新:
您可以使用的RegistryKey
下的类的Microsoft.Win32
命名空间。
You can use RegistryKey
class under Microsoft.Win32
namespace.
是的RegistryKey
有一些重要的功能如下:
Some important functions of RegistryKey
are as follows:
GetValue //to get value of a key
SetValue //to set value to a key
DeleteValue //to delete value of a key
OpenSubKey //to read value of a subkey (read-only)
CreateSubKey //to create new or edit value to a subkey
DeleteSubKey //to delete a subkey
GetValueKind //to retrieve the datatype of registry key
这篇关于阅读在C#中的注册表项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文