usb 차단

VNote 2017.09.12 14:01:14 *: Imports Microsoft.Win32

Public Class Form1
Dim Str As String = My.Computer.Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Services\USBSTOR").ToString


Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
My.Computer.Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Services\USBSTOR")
Label1.Text = My.Computer.Registry.GetValue(Str, "Start", "Error cannot load this")
If Label1.Text = 3 Then

End If
End Sub

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Registry.SetValue(Str, "Start", 3, RegistryValueKind.DWord)
My.Computer.Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Services\USBSTOR")
Label1.Text = My.Computer.Registry.GetValue(Str, "Start", "Error cannot load this")
End Sub

Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
Registry.SetValue(Str, "Start", 4, RegistryValueKind.DWord)
My.Computer.Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Services\USBSTOR")
Label1.Text = My.Computer.Registry.GetValue(Str, "Start", "Error cannot load this")
End Sub
End Class

        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />

            requestedExecutionLevel 노드를 지정하면 파일 및 레지스트리 가상화가 사용되지 않습니다.
            이전 버전과의 호환성을 위해 파일 및 레지스트리 시각화를 사용하려면 
            requestedExecutionLevel 노드를 삭제하십시오.
        -->
        <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />