hello !
i want to disable my usb port using c# or vb.net ,is it possible to do so using .net ? if yes then any idea how i can do this ?

Regards

The following gets a value from the registry. Normally it is set to 3. If you set it to 4 then USB access will be denied. However, setting the value requires admin access.

My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\USBSTOR\","Start",0)

To set a new value use

My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\USBSTOR\","Start",4,Microsoft.Win32.RegistryValueKind.DWord)

It is showing unauthorizedaccessexception, pls help, in win7