View Single Post
Old Jul 28th, 2006, 12:33 AM   #10
melbolt
Hobbyist Programmer
 
melbolt's Avatar
 
Join Date: Feb 2005
Location: PA, USA
Posts: 237
Rep Power: 4 melbolt is on a distinguished road
Send a message via AIM to melbolt Send a message via Yahoo to melbolt
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
__________________
I have never let my schooling interfere with my education. -Mark Twain-

Xbox live gamertag: melbolt
melbolt is offline   Reply With Quote