예제 #1
0
        public Form1(string[] args)
        {
            InitializeComponent();

            worker                     = new BackgroundWorker();
            worker.DoWork             += new DoWorkEventHandler(worker_DoWork);
            worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);

            CaptchaInterpreter.AllowGlobalDegugMessages();
            CaptchaInterpreter.OnGlobalBitmapMessage += new CaptchaInterpreter.BitmapMessageHandler(CaptchaInterpreter_OnGlobalBitmapMessage);

            if (args.Length > 0)
            {
                try
                {
                    Script = File.ReadAllText(args[0]);
                    Directory.SetCurrentDirectory(new FileInfo(args[0]).DirectoryName);

                    if (args[0].Contains("\\"))
                    {
                        textBox1.Text = args[0].Substring(args[0].LastIndexOf("\\") + 1);
                    }
                    else
                    {
                        textBox1.Text = "Script Loaded";
                    }
                }
                catch
                {
                    MessageBox.Show("Could not load script!", "CBL GUI", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
예제 #2
0
        public Form1()
        {
            InitializeComponent();

            image = null;

            worker                     = new BackgroundWorker();
            worker.DoWork             += new DoWorkEventHandler(worker_DoWork);
            worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);

            CaptchaInterpreter.AllowGlobalDegugMessages();
            CaptchaInterpreter.OnGlobalBitmapMessage += new CaptchaInterpreter.BitmapMessageHandler(CaptchaInterpreter_OnGlobalBitmapMessage);
            CaptchaInterpreter.OnError += new CaptchaInterpreter.ErrorNotificationHandler(CaptchaInterpreter_OnError);
            CaptchaInterpreter.OnInfo  += new CaptchaInterpreter.InformationMessageHandler(CaptchaInterpreter_OnInfo);
        }