1

C# を使用してボリュームに基づいて USB をブロックしたい。容量が8GBを超える場合、USBスティックをブロックしたいなど。

レジストリを使用して PC で USB をブロックする方法があることを確認します。ただし、これにより USB が検出されなくなるため、ボリューム情報を取得できません。

クライアント プログラムが一部のマシンで実行されていて、USB 容量 >=8GB を制限する必要がある場合、C# コードで USB を安全に削除し、バルーンを表示する必要があります。つまり、サイレントに削除します。

4

1 に答える 1

1

If you are disabling the USBSTOR key, then you prevent "ACCESS" to it, that includes gathering information from it.

I suggest you look here: WM_DEVICECHANGE

Using this you can catch when the USB is entered and then get the drive letter and use the DEV_BROADCAST_VOLUME to gather information on it, then you can disable it using your registry method.

于 2010-10-20T08:48:20.660 に答える