Esempio n. 1
0
 // Test harness.
 public static void Main(String[] args)
 {
     try
     {
         StrongNameIdentityDemo democase = new StrongNameIdentityDemo();
         bool ret = democase.RunDemo();
         if (ret)
         {
             Console.Out.WriteLine("StrongNameIdentity demo completed successfully.");
             Console.Out.WriteLine("Press the Enter key to exit.");
             string consoleInput = Console.ReadLine();
             System.Environment.ExitCode = 100;
         }
         else
         {
             Console.Out.WriteLine("StrongNameIdentity demo failed.");
             Console.Out.WriteLine("Press the Enter key to exit.");
             string consoleInput = Console.ReadLine();
             System.Environment.ExitCode = 101;
         }
     }
     catch (Exception e)
     {
         Console.Out.WriteLine("StrongNameIdentity demo failed.");
         Console.WriteLine(e.ToString());
         Console.Out.WriteLine("Press the Enter key to exit.");
         string consoleInput = Console.ReadLine();
         System.Environment.ExitCode = 101;
     }
     // Catch non-CLSCompliant exceptions.
     catch
     {
         Console.WriteLine("An unexpected non-CLSCompliant exception was thrown.");
     }
 }
Esempio n. 2
0
	// Test harness. 
	public static void Main(String[] args)
	{
		try
		{
			StrongNameIdentityDemo democase = new StrongNameIdentityDemo();
			bool ret = democase.RunDemo();
			if (ret)
			{
				Console.Out.WriteLine("StrongNameIdentity demo completed successfully.");
				Console.Out.WriteLine("Press the Enter key to exit.");
				string consoleInput = Console.ReadLine();
				System.Environment.ExitCode = 100;
			}
			else
			{
				Console.Out.WriteLine("StrongNameIdentity demo failed.");
				Console.Out.WriteLine("Press the Enter key to exit.");
				string consoleInput = Console.ReadLine();
				System.Environment.ExitCode = 101;
			}
		}
		catch (Exception e)
		{
			Console.Out.WriteLine("StrongNameIdentity demo failed.");
			Console.WriteLine(e.ToString());
			Console.Out.WriteLine("Press the Enter key to exit.");
			string consoleInput = Console.ReadLine();
			System.Environment.ExitCode = 101;
		}
		// Catch non-CLSCompliant exceptions. 
		catch
		{
			Console.WriteLine("An unexpected non-CLSCompliant exception was thrown.");
		}
	}