OKIEWARDOYO

C#.NET No.10-1

Dec 20th, 2012
2,875
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.30 KB | None | 0 0
  1. //tryCatchDemo.cs
  2. using System;
  3. using System.IO;
  4.  
  5. class tryCatchDemo
  6. {
  7.     static void Main(string[] args)
  8.     {
  9.         try
  10.         {
  11.             File.OpenRead("NonExistentFile");
  12.         }
  13.         catch(Exception ex)
  14.         {
  15.             Console.WriteLine(ex.ToString());
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment