示例#1
0
    public static void Main(String[] args)
    {
        Environment.ExitCode = 1;
        Boolean          bResult = false;
        Co6001FromString cbX     = new Co6001FromString();

        try {
            if (args[0].Equals("-v") == true)
            {
                Console.WriteLine("Activating Verbose Mode....");
                cbX.m_bVerbose = true;
            }
        } catch (Exception) {}
        try
        {
            bResult = cbX.runTest();
        }
        catch (Exception exc_main)
        {
            bResult = false;
            Console.WriteLine("FAiL!  Error Err_9999 (" + s_strTFAbbrev + ")!" +
                              "Uncaught Exception caught fell to Main(), " +
                              "exec = " + exc_main);
        }
        if (!bResult)
        {
            Console.WriteLine("Try using '-v' flag");
            Console.WriteLine(s_strTFPath + s_strTFName);
            Console.WriteLine(" ");
            Console.WriteLine("FAiL!  " + s_strTFAbbrev);
            Console.WriteLine(" ");
        }
        if (bResult == true)
        {
            Environment.ExitCode = 0;
        }
        else
        {
            Environment.ExitCode = 1;
        }
    }
 public static void Main( String[] args ) { 
 Environment.ExitCode = 1;  
 Boolean bResult = false; 
 Co6001FromString cbX = new Co6001FromString();
 try {
 if ( args[0].Equals("-v" ) == true ){
 Console.WriteLine( "Activating Verbose Mode...." );
 cbX.m_bVerbose = true;
 }
 } catch( Exception ) {}
 try
   {
   bResult = cbX.runTest();
   }
 catch ( Exception exc_main )
   {
   bResult = false;
   Console.WriteLine( "FAiL!  Error Err_9999 ("+ s_strTFAbbrev +")!" +
		      "Uncaught Exception caught fell to Main(), "+
		      "exec = "+ exc_main );
   }
 if ( ! bResult )
   {
   Console.WriteLine( "Try using '-v' flag" );
   Console.WriteLine( s_strTFPath + s_strTFName );
   Console.WriteLine( " " );
   Console.WriteLine( "FAiL!  "+ s_strTFAbbrev );  
   Console.WriteLine( " " );
   }
 if ( bResult == true ) Environment.ExitCode = 0; else Environment.ExitCode = 1; 
 }