コード例 #1
0
ファイル: TestFrm.cs プロジェクト: pisceanfoot/tbDRP
        public TestFrm()
        {
            InitializeComponent();

            this.editProductBrowser = new WebBrowserManager();
            this.editProductBrowser.DocumentComplete += editProductBrowser_DocumentComplete;

            this.editProductBrowser.Browser.Dock = DockStyle.Fill;
            this.Controls.Add(this.editProductBrowser.Browser);
        }
コード例 #2
0
ファイル: TaobaoLoginFrm.cs プロジェクト: pisceanfoot/tbDRP
        private void Init()
        {
            manager = new WebBrowserManager();
            WebBrowser webBrowser = manager.Browser;

            webBrowser.Dock = DockStyle.Fill;
            this.Controls.Add(webBrowser);

            // 登录成功后跳转到分销页面
            //webBrowser.Navigate("https://login.taobao.com/member/login.jhtml?redirectURL=http%3a%2f%2fgoods.gongxiao.tmall.com%2fdistributor%2fitem%2fmy_item_list.htm%3fonSale%3d0");
            webBrowser.Navigate("http://goods.gongxiao.tmall.com/distributor/item/my_item_list.htm?onSale=0");
            webBrowser.DocumentCompleted += webBrowser_DocumentCompleted;
        }
コード例 #3
0
        private void webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            WebBrowserEx webBrowser = sender as WebBrowserEx;

            if (webBrowser.ReadyState == WebBrowserReadyState.Complete)
            {
                if (e.Url.AbsolutePath != webBrowser.Url.AbsolutePath)
                {
                    return;
                }

                if (webBrowser.Url.AbsolutePath.Contains("distributor"))
                {
                    string html = Init(webBrowser);

                    // next page
                    if (html.IndexOf("class=\"page-next\"") != -1)
                    {
                        WebBrowserManager m = new WebBrowserManager(this.webBrowser);
                        var pageContainer   = m.FindID("dpl:pagination");
                        if (pageContainer != null)
                        {
                            pageContainer = m.FindClassName("page-next", pageContainer);
                        }
                        if (pageContainer != null)
                        {
                            m.ClickHelemnt(pageContainer);
                        }

                        this.TabText = "商品分销管理(加载中 ... ...)";
                    }
                    else
                    {
                        webBrowser.DocumentCompleted -= webBrowser_DocumentCompleted;
                        this.TabText = "商品分销管理(加载完成)";

                        ThreadRunner.Run(new Action(SearchNewTitle));
                    }
                }
            }
        }
コード例 #4
0
        public EditProductFrm(DistributionFrm parentFrm)
        {
            InitializeComponent();

            this.parentFrm = parentFrm;

            this.editProductBrowser = new WebBrowserManager();
            this.editProductBrowser.DocumentComplete += editProductBrowser_DocumentComplete;

            this.editProductBrowser.Browser.Dock = DockStyle.Fill;
            this.Controls.Add(this.editProductBrowser.Browser);

            checkDownTimer          = new Timer();
            checkDownTimer.Interval = 900;
            checkDownTimer.Tick    += checkDownTimer_Tick;
            checkDownTimer.Enabled  = false;

            this.clickTimer          = new Timer();
            this.clickTimer.Tick    += clickTimer_Tick;
            this.clickTimer.Interval = 2000;
            this.clickTimer.Enabled  = false;
        }
コード例 #5
0
        public FenXiaoFabuFrm()
        {
            InitializeComponent();

            list = new List <VenderModel>();

            manager = new WebBrowserManager();
            manager.DocumentComplete += manager_DocumentComplete;

            WebBrowser browser = manager.Browser;

            browser.Dock = DockStyle.Fill;
            splitContainer1.Panel2.Controls.Add(browser);

            addFenXiaoProductTimer          = new Timer();
            addFenXiaoProductTimer.Interval = 500;
            addFenXiaoProductTimer.Tick    += addFenXiaoProductTimer_Tick;
            addFenXiaoProductTimer.Enabled  = false;

            checkDownTimer          = new Timer();
            checkDownTimer.Interval = 800;
            checkDownTimer.Tick    += checkDownTimer_Tick;
            checkDownTimer.Enabled  = false;
        }