尝试禁用或启用端口时出现此问题。当我使用我朋友的笔记本电脑时,它运行良好,但当我尝试使用我的笔记本电脑时,它会出现此错误。为什么会发生这种情况以及如何解决?谢谢^^
Private Sub DisableBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DisableBtn.Click
Microsoft.Win32.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord) 'this line gives error
MessageBox.Show("Port are disable", "USB Disable", MessageBoxButtons.OK, MessageBoxIcon.Information)
Me.Hide()
Login.Show()
End Sub
Private Sub EnableBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EnableBtn.Click
Microsoft.Win32.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start", 3, Microsoft.Win32.RegistryValueKind.DWord) 'this line gives error
MessageBox.Show("Port are enable", "USB Enable", MessageBoxButtons.OK, MessageBoxIcon.Information)
Me.Hide()
Login.Show()
End Sub