Proper try-catch and funally block to handle Exception

Sourav.Kayal
Posted by Sourav.Kayal under C# category on | Points: 40 | Views : 1397
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Net.NetworkInformation;
using System.Threading;
using System.Globalization;
namespace Test1
{
class Program
{
static void Main(string[] args)
{
//Exception handeling mechanism
try
{
throw new Exception("This is exceptio");
}
catch (Exception ex)
{
Console.Write(ex.Message);
}
finally
{
//Release your resource here
}
Console.ReadLine();
}
}
}

Comments or Responses

Login to post response