开发者

Read value of server registry key from client application

开发者 https://www.devze.com 2023-02-16 14:52 出处:网络
I have a WinForms app that I am using on a local network. I want to read the value of a specific key from the registry of the server -- how can I do this? If I\'m a user on the local network, can I ge

I have a WinForms app that I am using on a local network. I want to read the value of a specific key from the registry of the server -- how can I do this? If I'm a user on the local network, can I get this value from the server? Thanks in advance for any help.

i want to read this key:

HKEY_LOCAL_MACHINE>microsoft>microsoft sql se开发者_运维百科rver>SQLEXPRESS>Setup>SQLPATH


You want to look into the RegistryKey class. Specifically, the OpenRemoteBaseKey method. Be sure to read the remarks, among them: both the server and client have to be running the remote registry service, and the client must have the proper access. You'll probably want to read the remarks for RegConnectRemoteKey, as well, because that's the underlying function that the .NET wrapper calls.

0

精彩评论

暂无评论...
验证码 换一张
取 消