File Access Error

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

Just a couple of general questions about errors related to accessing drives.

I seem to remember in VB6 there were a list of error numbers you could test
for when you attempted to access a drive, such as "Drive not ready". In
VB.Net do I have to test for the specific text or is there a list of these
error code and meanings?

When I look of the method Directory.GetDirectories(myPath), I see nothing
right there for the type of exceptions which can be generated by this method.
How do I find the list of all the exceptions "types" ( catch es
"exceptionType") that this method can generate or can be generated as a result
of running this method?

Thanks in advance for your assistance!!!!!!!!!
 
Hello,

Jim Heavey said:
I seem to remember in VB6 there were a list of error numbers you could test
for when you attempted to access a drive, such as "Drive not ready". In
VB.Net do I have to test for the specific text or is there a list of these
error code and meanings?

You will find a list of exceptions which can be thrown by the method in the
documentation:

http://msdn.microsoft.com/library/e...ystemiodirectoryclassgetdirectoriestopic1.asp
When I look of the method Directory.GetDirectories(myPath),
I see nothing right there for the type of exceptions which can be
generated by this method.

Walkthrough: Structured Exception Handling
http://msdn.microsoft.com/library/en-us/vbcn7/html/vawlkwalkthroughstructuredexceptionhandling.asp

HTH,
Herfried K. Wagner
 
Jim Heavey said:
Just a couple of general questions about errors related to accessing
drives.

I seem to remember in VB6 there were a list of error numbers you
could test for when you attempted to access a drive, such as "Drive
not ready". In VB.Net do I have to test for the specific text or is
there a list of these error code and meanings?

When I look of the method Directory.GetDirectories(myPath), I see
nothing right there for the type of exceptions which can be generated
by this method. How do I find the list of all the exceptions "types"
( catch es "exceptionType") that this method can generate or can be
generated as a result of running this method?

Thanks in advance for your assistance!!!!!!!!!

My docs (<F1>) for Directory.GetDirectories lists
- UnauthorizedAccessException
- ArgumentException
- ArgumentNullException
- PathTooLongException
- IOException
- DirectoryNotFoundException

In general, it can happen that (unfortunatelly) not all exceptions are
listed. Can't remember which one, but must have been some within several
thousands.
 
Back
Top