CD-ROM suspends the application execution

  • Thread starter Thread starter Pino
  • Start date Start date
P

Pino

Hi to all.

I'm writing an application which should read data from CD-ROM.

I have the application started and I I insert the CD-ROM in the reader.
Subsequently, I click the button for read the data, but the Windows Form not
respond for a couple of seconds.

Are there any methods to read the CD-ROM in the background without having
the form in not responding status?

This is the same problem when I insert the CD-ROM in Windows Explorer...

Thanks,

Pino.
 
Pino said:
I'm writing an application which should read data from CD-ROM.

I have the application started and I I insert the CD-ROM in the reader.
Subsequently, I click the button for read the data, but the Windows Form not
respond for a couple of seconds.

Are there any methods to read the CD-ROM in the background without having
the form in not responding status?

This is the same problem when I insert the CD-ROM in Windows Explorer...

You need to do the IO in worker thread. This is generally a good idea
anyway, as you never know when you might be given a very large file to
read, etc.

See http://www.pobox.com/~skeet/csharp/threads and in particular
http://www.pobox.com/~skeet/csharp/threads/winforms.shtml
 
Back
Top