Geekpedia Tutorials Home

Building a C# Chat Client and Server

Building a C# Chat Client and ServerA 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.

in C# Programming Tutorials

Getting Hard Drive Information

Getting Hard Drive InformationA C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.

in C# Programming Tutorials

UPS Shipping Calculator

UPS Shipping CalculatorThis 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.

in PHP Programming Tutorials

Create Your Own Rich Text Editor

Create Your Own Rich Text EditorCreating 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.

in JavaScript Programming Tutorials
Search
Tutorials
Programming Tutorials
IT Jobs
From CareerBuilder

Win32_DeviceChangeEvent And Prohibit Access USB

On Friday, August 28th 2009 at 11:58 AM
By Tolga Ongunsu
I generated the code below with wmi code creator. It listens the device
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);
}
Sponsors
Discover Geekpedia

Other Resources