示例#1
0
        Main(
            string[] args
            )
        {
            const string usageAppHealthStatus = "Usage: AppHealth status <hostMachine> <vmName>";

            try
            {
                AppHealthStatus appHealth = new AppHealthStatus();

                if (args == null || args.Length == 0)
                {
                    Console.WriteLine(usageAppHealthStatus);
                }
                else if (args[0].Equals("status", StringComparison.OrdinalIgnoreCase))
                {
                    if (args.Length != 3)
                    {
                        Console.WriteLine(usageAppHealthStatus);
                    }
                    else
                    {
                        appHealth.GetAppHealthStatus(args[1], args[2]);
                    }
                }
                else
                {
                    Console.WriteLine("Incorrect option");
                }

                Console.WriteLine("Please press ENTER to exit...");
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
        }
        Main(
            string[] args
            )
        {
            const string usageAppHealthStatus = "Usage: AppHealth status <hostMachine> <vmName>";

            try
            {
                AppHealthStatus appHealth = new AppHealthStatus();

                if (args == null || args.Length == 0)
                {
                    Console.WriteLine(usageAppHealthStatus);
                }
                else if (args[0].Equals("status", StringComparison.OrdinalIgnoreCase))
                {
                    if (args.Length != 3)
                    {
                        Console.WriteLine(usageAppHealthStatus);
                    }
                    else
                    {
                        appHealth.GetAppHealthStatus(args[1], args[2]);
                    }
                }
                else
                {
                    Console.WriteLine("Incorrect option");
                }

                Console.WriteLine("Please press ENTER to exit...");
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
        }