CD-ROM suspends the application execution

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.
 
J

Jon Skeet [C# MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top