using System;
using System.IO;
public class Program
{
public static void Main()
try
//some code
var filestream = File.Open("filename",FileMode.Open);
/* kann ArgumentException,
ArgumentNullException,
PathTooLongException,
DirectoryNotFoundException,
IOException,
UnauthorizedAccessException,
ArgumentOutOfRangeException,
NotSupportedException
und FileNotFoundException werfen
*/
//some more code
}
catch (FileNotFoundException e)
Console.WriteLine("FileNotFoundException caught");
throw new Exception("Something went wrong", e);