如何使用C#来改变远程系统的注册表值 [英] How to change the registry value of remote system using C#

查看:428
本文介绍了如何使用C#来改变远程系统的注册表值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

海的每一个 我开发一个Windows应用程序中,我必须阻止通过改变HKEY_LOCAL_MACHINE \ SYSTEM的注册表值\ CURRENTCONTROLSET \ SERVICES \ USBSTOR可移动存储设备,如pendrives.I发现,其可能的,开始的价值4.But问题我必须阻止它在远程系统上too.Can任何一个建议我如何使用C#与code或网站,我可以我找到code这个更改远程系统的注册表的值。

Hai every one I am developing an windows application in which i have to block the removable storage devices such as pendrives.I found that its possible by changing the registry value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor,start value to 4.But the problem is I have to block it on remote systems too.Can any one suggest me how to change the value of registry of remote system using c# with a code or sites where i can i find the code for this.

推荐答案

在.NET的方法是使用的 Microsoft.Win32.RegistryKey.OpenRemoteBaseKey

The .net way is to use Microsoft.Win32.RegistryKey.OpenRemoteBaseKey.

另一种方法是使用WMI。 有很多的例子在谷歌读数值;与 SetStringValue (或SetDWORDValue等替代向GetStringValue )应该做你想要什么。

An alternative would be to use WMI. There are lots of examples on Google for reading values; replacing GetStringValue with SetStringValue (or SetDWORDValue, etc.) should do what you want.

这篇关于如何使用C#来改变远程系统的注册表值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆