예제 #1
0
 private void OnEnableClicked(object sender, RoutedEventArgs e)
 {
     try
     {
         FiddlerIISProxy.On();
         DrawStatus();
     }
     catch (Exception exception)
     {
         ShowMessageBoxWithError(exception);
     }
 }
예제 #2
0
파일: Program.cs 프로젝트: eaardal/diddle
        public static void Main(string[] args)
        {
            try
            {
                if (args.Length != 1)
                {
                    PrintHelp();
                    return;
                }

                switch (args[0])
                {
                case "on":
                    FiddlerIISProxy.On();
                    break;

                case "off":
                    FiddlerIISProxy.Off();
                    break;

                case "status":
                    var status = FiddlerIISProxy.Status();
                    if (status)
                    {
                        Console.ForegroundColor = ConsoleColor.Green;
                        Console.WriteLine("On");
                    }
                    else
                    {
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine("Off");
                    }
                    Console.ResetColor();
                    break;
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }