SHARE
TWEET

Simplest exception catching with printing stacktrace

amironov73 Jan 20th, 2017 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. using ManagedClient;
  4.  
  5. class Program
  6. {
  7.     static void Main()
  8.     {
  9.         try
  10.         {
  11.             string connectionString = "host=127.0.0.1;port=6666;user=1;password=1";
  12.  
  13.             using (ManagedClient64 client = new ManagedClient64())
  14.             {
  15.                 client.ParseConnectionString(connectionString);
  16.                 client.Connect();
  17.  
  18.                 int maxMfn = client.GetMaxMfn();
  19.                 Console.WriteLine("Max MFN={0}", maxMfn);
  20.             }
  21.         }
  22.         catch (Exception exception)
  23.         {
  24.             Console.WriteLine("Exception occurred: {0}", exception);
  25.         }
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top