i'd use the IOException class
you could do it like this(i know this is a directory but same concept)
DirectoryInfo dir = new DirectoryInfo(@"F:\WINNT");
try
{
dir.CreateSubdirectory("Sub");
dir.CreateSubdirectory(@"Sub\MySub");
}
catch(IOException e)
{
Console.WriteLine(e.Message);
}
(I stole this code from here:
http://www.codeguru.com/Csharp/Cshar...cle.php/c5861/)
OR here's an example of sorting out the IOException
http://www.java2s.com/Code/CSharp/La...OException.htm