USB Write Protected

psycho-j

New member
Joined
Jan 5, 2008
Messages
1
Programming Experience
3-5
I have a service that labels a USB Device upon detection but cannot get it to stop trying to write when USB is "locked / write protected". This causes a system hang. I would love some help with this.

Thankx in advance
 
To expand on DiskJunky's post, the Try/Catch blocks can have multiple Catch statements.

VB.NET:
Try
     'code to write the file
Catch exIO as IOException
     'this will happen if there is a lock on the file or if the file cannot be written for some other reason check the 'exIO' variable for more info

Catch ex As Exception
  'this will happen if there's a problem that's not an IOException and when you use multiple catch statements, always put this one last (as a fail safe)
End Try
 
Back
Top