A step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.
A C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.
This tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.
Creating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.
Win32_DeviceChangeEvent And Prohibit Access USB |
On Friday, August 28th 2009 at 11:58 AM By Tolga Ongunsu |
|
|
changings. I want to prohibit the usb access or cdrom access in my computer section. Is there any ideas about it like sddl ...??? Thanks in advance. try { WqlEventQuery query = new WqlEventQuery( "SELECT * FROM Win32_DeviceChangeEvent"); ManagementEventWatcher watcher = new ManagementEventWatcher(query); Console.WriteLine("Waiting for an event..."); ManagementBaseObject eventObj = watcher.WaitForNextEvent(); Console.WriteLine("{0} event occurred.", eventObj["__CLASS"]); // Cancel the event subscription watcher.Stop(); return; } catch(ManagementException err) { MessageBox.Show("An error occurred while trying to receive an event: " + err.Message); } |
||