motoburn
Member
Does anyone know a link to a list of IOException codes or some way of catching a specific error?
I have been digging for a couple hours trying to find a code, or a number to catch when my app throws
For this app, I am simply moving all files in specified directory to a directory on the file server. It is likely that a file being moved will already exist, in which case, I need to move the file to a different directory so it can be analyzed...
I am sure I could run
but I thought it would be cleaner in a Try/Catch block.
Should I just use the If/Then? I have used the MySqlException which has a number assigned to each exception, so I can catch duplicate keys and insert them into a temp table for analysis.... was hoping to do something similar here, but I can't seem to find any reference to System.IO.IOException's..
I'm sure this is a simple noob question, but, there it is. Thanks for any help in advance
Chris
I have been digging for a couple hours trying to find a code, or a number to catch when my app throws
VB.NET:
System.IO.IOException was unhandled
Message="The file exists. "
Source="mscorlib"
For this app, I am simply moving all files in specified directory to a directory on the file server. It is likely that a file being moved will already exist, in which case, I need to move the file to a different directory so it can be analyzed...
I am sure I could run
VB.NET:
If File.Exists(...)=False Then
File.Move(...)
Else
File.move(..., somewhereElse)
end if
Should I just use the If/Then? I have used the MySqlException which has a number assigned to each exception, so I can catch duplicate keys and insert them into a temp table for analysis.... was hoping to do something similar here, but I can't seem to find any reference to System.IO.IOException's..
I'm sure this is a simple noob question, but, there it is. Thanks for any help in advance
Chris