修改注册表以达到禁止目的 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click '禁止使用U盘(将值从改为) My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/USBSTOR", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click '可以使用U盘(将值从改为) My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/USBSTOR", "Start", 3, Microsoft.Win32.RegistryValueKind.DWord) End Sub