Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //tryCatchDemo.cs
- using System;
- using System.IO;
- class tryCatchDemo
- {
- static void Main(string[] args)
- {
- try
- {
- File.OpenRead("NonExistentFile");
- }
- catch(Exception ex)
- {
- Console.WriteLine(ex.ToString());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment