예제 #1
0
        public async Task ProcessArrowLinkAsync()
        {
            try {
                //Console.Title = Name;
                while (num < TotalCount)
                {
                    //foreach (DataRow row in data.Tables[0].Rows)
                    //{
                    try
                    {
                        //cEXWB1 = new csExWB.cEXWB();
                        //fbrowser = cEXWB1;
                        isprocess  = true;
                        ppcount    = 0;
                        SourceLink = string.Empty;
                        LabelLog("Processing link " + (num + 1) + " of " + TotalCount);
                        sourceid   = 0;
                        SourceLink = data.Tables[0].Rows[num].ItemArray[1].ToString().Split('\t')[0].Trim();
                        sourceid   = int.Parse(data.Tables[0].Rows[num].ItemArray[0].ToString());
                        fbrowser.Navigate(SourceLink);
                        await Task.Delay(7000);

                        //ProcessArrowHTML();
                        FastenalSearchProLinkPageAsync();
                        //timer.Start();
                    }
                    catch
                    {
                    }
                    //}
                }
            }
            catch { }
        }
예제 #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     //Form1.Name = Name;
     num      = 0;
     fbrowser = cEXWB1;
     cEXWB1.RegisterAsBrowser = true;
     //panel1.Controls.Add(fbrowser);
     fbrowser.Navigate("www.google.com");
     Task.Delay(5000);
     //ArrowProcess();
     FastenalProcess();
 }
예제 #3
0
        private bool AddNewBrowser(string TabText, string TabTooltip, string Url, bool BringToFront)
        {
            //Copy flags
            int iDochostUIFlag = (int)(DOCHOSTUIFLAG.NO3DBORDER |
                        DOCHOSTUIFLAG.FLAT_SCROLLBAR | DOCHOSTUIFLAG.THEME);
            int iDocDlCltFlag = (int)(DOCDOWNLOADCTLFLAG.DLIMAGES |
                        DOCDOWNLOADCTLFLAG.BGSOUNDS | DOCDOWNLOADCTLFLAG.VIDEOS);

            if (m_CurWB != null)
            {
                iDochostUIFlag = m_CurWB.WBDOCHOSTUIFLAG;
                iDocDlCltFlag = m_CurWB.WBDOCDOWNLOADCTLFLAG;
            }

            csExWB.cEXWB pWB = null;

            int i = m_iCountWB + 1;
            string sname = "cEXWB" + i.ToString();

            try
            {
                ToolStripButton btn = new ToolStripButton();
                btn.ImageAlign = ContentAlignment.MiddleCenter;
                btn.ImageScaling = ToolStripItemImageScaling.None;
                btn.TextAlign = ContentAlignment.TopLeft;
                btn.TextImageRelation = TextImageRelation.TextAboveImage;
                btn.Name = sname;
                if (TabText.Length > 0)
                    btn.Text = TabText;
                else
                    btn.Text = m_Blank;
                btn.Image = m_BlankImage;
                if (TabTooltip.Length > 0)
                    btn.ToolTipText = TabTooltip;
                btn.AutoToolTip = true;
                btn.MouseUp += new MouseEventHandler(this.tsWBTabs_ToolStripButtonCtxMenuHandler);
                tsWBTabs.Items.Add(btn);

                //Create and setup browser
                pWB = new csExWB.cEXWB();

                //pWB.Dock = cEXWB1.Dock;
                pWB.Anchor = cEXWB1.Anchor;
                pWB.Name = sname;
                pWB.Location = cEXWB1.Location;
                pWB.Size = cEXWB1.Size;

                pWB.RegisterAsBrowser = true;
                pWB.WBDOCDOWNLOADCTLFLAG = iDocDlCltFlag;
                pWB.WBDOCHOSTUIFLAG = iDochostUIFlag;
                pWB.FileDownloadDirectory = cEXWB1.FileDownloadDirectory;

                //Add events, using the same eventhandlers for all browsers
                pWB.TitleChange += new csExWB.TitleChangeEventHandler(this.cEXWB1_TitleChange);
                pWB.StatusTextChange += new csExWB.StatusTextChangeEventHandler(this.cEXWB1_StatusTextChange);
                pWB.CommandStateChange += new csExWB.CommandStateChangeEventHandler(this.cEXWB1_CommandStateChange);
                pWB.WBKeyDown += new csExWB.WBKeyDownEventHandler(this.cEXWB1_WBKeyDown);
                pWB.WBEvaluteNewWindow += new csExWB.EvaluateNewWindowEventHandler(this.cEXWB1_WBEvaluteNewWindow);
                pWB.BeforeNavigate2 += new csExWB.BeforeNavigate2EventHandler(this.cEXWB1_BeforeNavigate2);
                pWB.ProgressChange += new csExWB.ProgressChangeEventHandler(this.cEXWB1_ProgressChange);
                pWB.NavigateComplete2 += new csExWB.NavigateComplete2EventHandler(this.cEXWB1_NavigateComplete2);
                pWB.DownloadBegin += new csExWB.DownloadBeginEventHandler(this.cEXWB1_DownloadBegin);
                pWB.ScriptError += new csExWB.ScriptErrorEventHandler(this.cEXWB1_ScriptError);
                pWB.DownloadComplete += new csExWB.DownloadCompleteEventHandler(this.cEXWB1_DownloadComplete);
                pWB.StatusTextChange += new csExWB.StatusTextChangeEventHandler(this.cEXWB1_StatusTextChange);
                pWB.DocumentCompleteEX += new csExWB.DocumentCompleteExEventHandler(this.cEXWB1_DocumentCompleteEX);
                pWB.WBDragDrop += new csExWB.WBDropEventHandler(cEXWB1_WBDragDrop);
                pWB.SetSecureLockIcon += new csExWB.SetSecureLockIconEventHandler(this.cEXWB1_SetSecureLockIcon);
                pWB.NavigateError += new csExWB.NavigateErrorEventHandler(this.cEXWB1_NavigateError);
                pWB.WBSecurityProblem += new csExWB.SecurityProblemEventHandler(this.cEXWB1_WBSecurityProblem);
                pWB.NewWindow2 += new csExWB.NewWindow2EventHandler(this.cEXWB1_NewWindow2);
                pWB.DocumentComplete += new csExWB.DocumentCompleteEventHandler(this.cEXWB1_DocumentComplete);
                pWB.NewWindow3 += new csExWB.NewWindow3EventHandler(this.cEXWB1_NewWindow3);
                pWB.WBKeyUp += new csExWB.WBKeyUpEventHandler(this.cEXWB1_WBKeyUp);
                pWB.WindowClosing += new csExWB.WindowClosingEventHandler(this.cEXWB1_WindowClosing);
                pWB.WBContextMenu += new csExWB.ContextMenuEventHandler(this.cEXWB1_WBContextMenu);
                pWB.WBDocHostShowUIShowMessage += new csExWB.DocHostShowUIShowMessageEventHandler(this.cEXWB1_WBDocHostShowUIShowMessage);
                pWB.FileDownload += new csExWB.FileDownloadEventHandler(this.cEXWB1_FileDownload);
                pWB.WBAuthenticate += new csExWB.AuthenticateEventHandler(this.cEXWB1_WBAuthenticate);
                pWB.WBStop += new csExWB.StopEventHandler(cEXWB1_WBStop);

                pWB.FileDownloadExStart += new csExWB.FileDownloadExEventHandler(cEXWB1_FileDownloadExStart);
                pWB.FileDownloadExEnd += new csExWB.FileDownloadExEndEventHandler(cEXWB1_FileDownloadExEnd);
                pWB.FileDownloadExProgress += new csExWB.FileDownloadExProgressEventHandler(cEXWB1_FileDownloadExProgress);
                pWB.FileDownloadExError += new csExWB.FileDownloadExErrorEventHandler(cEXWB1_FileDownloadExError);
                pWB.FileDownloadExAuthenticate += new csExWB.FileDownloadExAuthenticateEventHandler(cEXWB1_FileDownloadExAuthenticate);
                pWB.FileDownloadExDownloadFileFullyWritten += new csExWB.FileDownloadExDownloadFileFullyWrittenEventHandler(cEXWB1_FileDownloadExDownloadFileFullyWritten);

                pWB.WBStop += new csExWB.StopEventHandler(cEXWB1_WBStop);
                //pWB.ProcessUrlAction += new csExWB.ProcessUrlActionEventHandler(cEXWB1_ProcessUrlAction);

                pWB.WBLButtonDown += new csExWB.HTMLMouseEventHandler(cEXWB1_WBLButtonDown);
                pWB.WBLButtonUp += new csExWB.HTMLMouseEventHandler(cEXWB1_WBLButtonUp);
                //pWB.WBMouseMove += new csExWB.HTMLMouseEventHandler(cEXWB1_WBMouseMove);

                ////pWB.RegisterAsBrowser = true;

                //Add to controls collection
                //this.Controls.Add(pWB);
                this.toolStripContainer1.ContentPanel.Controls.Add(pWB);

                ToolStripMenuItem menu = new ToolStripMenuItem(btn.Text, m_imgUnLock);
                menu.Name = sname;
                ctxMnuOpenWBs.Items.Add((ToolStripItem)menu);

                if (BringToFront)
                {
                    //Uncheck last tab
                    ((ToolStripButton)tsWBTabs.Items[m_iCurTab]).Checked = false;
                    btn.Checked = true;

                    ((ToolStripMenuItem)ctxMnuOpenWBs.Items[m_iCurMenu]).Checked = false;
                    m_iCurMenu = ctxMnuOpenWBs.Items.Count - 1;
                    menu.Checked = true;

                    //Adjust current browser pointer
                    m_CurWB = pWB;
                    //Adjust current tab index
                    m_iCurTab = tsWBTabs.Items.Count - 1;
                    //Reset and hide progressbar
                    tsProgress.Value = 0;
                    tsProgress.Maximum = 0;
                    tsProgress.Visible = false;
                    //Bring to front
                    pWB.BringToFront();
                }
                //Increase count
                m_iCountWB++;
                tsBtnOpenWBs.Text = m_iCountWB.ToString() + " open tab(s)";

                if (Url.Length > 0)
                    pWB.Navigate(Url);
            }
            catch (Exception ee)
            {
                AllForms.m_frmLog.AppendToLog("AddNewBrowser\r\n" + ee.ToString());
                return false;
            }

            return true;
        }