예제 #1
0
        static void Main(string[] args)
        {
            // Browser
            IBrowserService browserService = new BrowserManager();

            browserService.Request("https://www.google.com/recaptcha/api2/demo");
            //browserService.Request("https://patrickhlauke.github.io/recaptcha/");
            //browserService.Request("https://recaptcha-demo.appspot.com/recaptcha-v2-checkbox-explicit.php");
            //browserService.Request("https://recaptcha-demo.appspot.com/recaptcha-v2-checkbox.php");


            // reCaptcha.Resolver
            ResolverService resolverService = new ResolverService(
                "IBM Speech to Text Api Key",
                "IBM Speech to Text Service Url"
                );


            // Set WebDriver
            resolverService.SetDriver(browserService.Driver);

            // Result
            var result = resolverService.GetResolve();

            Console.WriteLine(result);
            if (string.IsNullOrEmpty(result))
            {
                Console.WriteLine("false");
            }
            else
            {
                Console.WriteLine("true");
            }


            Console.ReadLine();
        }
        /// <summary>
        /// Attempts to resolve a type using default options.
        /// </summary>
        /// <typeparam name="T">The type of the controller</typeparam>
        /// <param name="dte2">The dte2.</param>
        /// <returns>Instance of the controller.</returns>
        internal static T ResolveController <T>(DTE2 dte2)
            where T : class
        {
            TraceService.WriteLine("NinjaController::ResolveController");

            Initialize();

            ResolverService resolverService = new ResolverService();

            T t = resolverService.Resolve <T>();

            if (dte2 != null)
            {
                BaseController controller = t as BaseController;

                if (controller != null)
                {
                    TraceService.WriteLine("**Setting DTE2**");
                    controller.SetDte2(dte2);
                }
            }

            return(t);
        }