Throw and Catch an IO exception because the file zxcvb.data doesn't exist : Buildin Exceptions : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » Buildin Exceptions »

 

Throw and Catch an IO exception because the file zxcvb.data doesn't exist








    


using System.IO;

public class IoError {
  public static void Main() {
    StreamReader f;
    try{
      f = new StreamReader("DoesNotExist.data");
    }catch(IOException e) {
      System.Console.WriteLine(e);
    }
    f = new StreamReader("DoesNotExist.data");
  }
}
           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» Buildin Exceptions