- Where Developers Learn, Share, & Build Careers


The DriveInfo class sometimes displays a windows message popup when using "itemprop =" text ">

after

Insert a disk in

code The fact that I am working with is quite standard:

  var driveInfos = DriveInfo.GetDrives (); Foreach (DriveInfo DriveInfo in driveInfO) {try (driveInfo.IsReady & amp; (DriveInfo.DriveType == DriveType.Network || driveInfo.DriveType == DriveType.Removable)} {var driveText = String.Format ( "{0} ({1})", driveInfo.VolumeLabel, driveInfo.Name);  had a glance on the web  

After it came to know that this is an unusual error, but one is the problem of environmental issues on the machine (people are reporting this as happening When things go like chrome) because of A lot of people have fixed this by clearing old usb references.

The error does not really stop the program from working normally in a different way than displaying this message. (And does not get stuck in the catch block)

It is a WPF application that is going to be deleted and instead of running End Users PC, a message box has not been displayed to me. How can I do this and what effect does it have?

Edit:

Further investigation has shown that this behavior is happening because this code is being executed by the background worker and two of its examples are same Running in time.

It is running without having to use the same code and executing the same code without using the background code.

I tested your code and it is not a problem. Because of this, it asks for every drive; driveInfo.IsReady is causing the reason for your problem (CD / DVD / ...). First check DriveType and then check IsReady ; Such as: (driveInfo.DriveType == DriveType.Network || driveInfo.DriveType == DriveType.Removable) if (driveInfo.IsReady) {var driveText = string.Format ("{0} ({1})", driveInfo. VolumeLabel, driveInfo.Name); }

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -