我试图在 VB 中翻译这段代码,但我不知道该怎么做……谁能告诉我翻译如何?
谢谢
private void WatchForDrives()
{
DeviceStatusMonitor monitor = new DeviceStatusMonitor(DeviceClass.FileSystem, false);
monitor.StartStatusMonitoring();
monitor.DeviceNotification += delegate(object sender, DeviceNotificationArgs e)
{
string message = string.Format("Disk '{0}' has been {1}.", e.DeviceName, e.DeviceAttached ? "inserted" : "removed");
MessageBox.Show(message, "Disk Status");
};
}