-
File in use Exception
Maybe I dont see it or i m missing something, but is there a non generic IOException that covers file in use, or perhaps some other type of Exception? As far as I can tell, no, but wanted to see if I missed it.
Right now I am using Catch FileinUse As IOException, but its best to use specific ones if they exist.
Anyone?
-
Which object are you using? The StreamWriter throws an UnauthorizedAccessException when access is denied to a file.
-
Sorry forgot. I m using the Stream object
Dim openfile As Stream = File.Open(blah, blah..etc.)
UnauthorizedAccessException doesnt work
-
IOException is what gets thrown.
-
Yeah. I just noticed that it will tell me the 'best' one when it goes off. Oh well. Generic IOException it is then.
-
May be u have opened this anyehre and not closed the reference
-
No. Im not worried about what is causing an error. My question was about Exception types.
-
It is a baseclass of Exception class
and throws if we acess a file which is in use
need to be catched
-
Dude. I already know the answer to this. And that still isnt the appropriate answer anyway.
-
LOL.....Cander, I sometimes wonder was is going through the minds of some when they post answers like the above...:D
-
Well he was trying. I think he just misunderstood what i was asking.
-
ohh I just found this. Under Debug on the VS menu, hit Exceptions. You get a nice list of exceptions. Very helpful.