|
-
Apr 30th, 2003, 10:22 AM
#1
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?
-
Apr 30th, 2003, 11:32 AM
#2
PowerPoster
Which object are you using? The StreamWriter throws an UnauthorizedAccessException when access is denied to a file.
-
Apr 30th, 2003, 11:40 AM
#3
Sorry forgot. I m using the Stream object
Dim openfile As Stream = File.Open(blah, blah..etc.)
UnauthorizedAccessException doesnt work
-
Apr 30th, 2003, 11:50 AM
#4
PowerPoster
IOException is what gets thrown.
-
Apr 30th, 2003, 11:57 AM
#5
Yeah. I just noticed that it will tell me the 'best' one when it goes off. Oh well. Generic IOException it is then.
-
Apr 30th, 2003, 12:09 PM
#6
Addicted Member
May be u have opened this anyehre and not closed the reference
Variety is the spice of life
-
Apr 30th, 2003, 12:13 PM
#7
No. Im not worried about what is causing an error. My question was about Exception types.
-
Apr 30th, 2003, 12:22 PM
#8
Addicted Member
It is a baseclass of Exception class
and throws if we acess a file which is in use
need to be catched
Variety is the spice of life
-
Apr 30th, 2003, 12:36 PM
#9
Dude. I already know the answer to this. And that still isnt the appropriate answer anyway.
-
Apr 30th, 2003, 12:41 PM
#10
PowerPoster
LOL.....Cander, I sometimes wonder was is going through the minds of some when they post answers like the above...
-
Apr 30th, 2003, 12:44 PM
#11
Well he was trying. I think he just misunderstood what i was asking.
-
Apr 30th, 2003, 12:48 PM
#12
ohh I just found this. Under Debug on the VS menu, hit Exceptions. You get a nice list of exceptions. Very helpful.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|