Open a file with exception handling
FileStream fin;
try {
fin = new FileStream("test.dat", FileMode.Open);
}
catch(FileNotFoundException exc) {
Console.WriteLine(exc.Message);
return;
}
catch {
Console.WriteLine("Cannot open file.");
return;
}
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|