限制读取USB驱动器(大容量存储)的权限 [英] Restrict Permission to read Usb Drive(Mass Storage)

查看:143
本文介绍了限制读取USB驱动器(大容量存储)的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阻止所有USB端口

Block All Usb Port

RegistryKey key = Registry.LocalMachine.OpenSubKey
    ("SYSTEM\\CurrentControlSet\\Services\\UsbStor",true);
if (key != null)
{
    key.SetValue("Start", 4, RegistryValueKind.DWord);
}
key.Close();


取消阻止所有USB端口.


unblock all usb port.

RegistryKey key = Registry.LocalMachine.OpenSubKey
    ("SYSTEM\\CurrentControlSet\\Services\\UsbStor", true);
if (key != null)
{
    key.SetValue("Start", 3, RegistryValueKind.DWord);
}
key.Close();


我要阻止USB封锁.它显示驱动器,但是单击或右键单击它会显示访问被拒绝.
请帮助我


I want to impelment Usb block. which shows the drive but on click or right click it shows access is denied.
please help me

推荐答案

如果您要在Vista或Windows 7上运行此应用程序,则需要使用以管理员身份运行"权限运行该应用程序.
If you are you running this application on Vista or Windows 7, you will need to run this application using ''Run as administrator'' privileges.


这篇关于限制读取USB驱动器(大容量存储)的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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