Exemplo n.º 1
0
 private void ReNavigateWeb(string url = null)
 {
     if (url == null)
     {
         url = ipWebShowUrl.Text;
     }
     else
     {
         ipWebShowUrl.Text = url;
     }
     if (!url.StartsWith("http"))
     {
         ipWebShowUrl.Text = "http://" + url;
     }
     WebShow.Navigate(ipWebShowUrl.Text);
 }
Exemplo n.º 2
0
        public void CheckNewCmd(CmdInfo cmdInfo, string targetUrl)
        {
            switch (cmdInfo)
            {
            case CmdInfo.None:
                break;

            case CmdInfo.SubClose:
                this.Invoke((EventHandler) delegate { this.Close(); });
                return;

            case CmdInfo.ShowWeb:
            {
                this.Invoke((EventHandler) delegate
                    {
                        this.Focus();
                        this.TopMost     = true;
                        this.WindowState = FormWindowState.Normal;
                        ReNavigateWeb(targetUrl);
                    });
            }
            break;

            case CmdInfo.InitWeb:
            {
                this.Invoke((EventHandler) delegate
                    {
                        this.Text = Program.thisExeThreadId + ":" + ClientName;
                        if (targetUrl.Length == 0)
                        {
                            targetUrl = "http://xy2.cbg.163.com/";
                        }
                        else
                        {
                            Console.WriteLine("读取网页成功:" + ClientName);
                        }
                        ReNavigateWeb(targetUrl);
                    });

                break;
            }

            case CmdInfo.SubmitBill:
            {
                this.Invoke((EventHandler) delegate
                    {
                        this.Focus();
                        this.TopMost     = true;
                        this.WindowState = FormWindowState.Normal;

                        //TrySubmitBill(targetUrl);//支持浏览器下单
                    });
                break;
            }

            case CmdInfo.OnlyRefresh:
                this.Invoke((EventHandler) delegate
                {
                    this.Text = Program.thisExeThreadId + ":" + ClientName + "--刷新";
                    WebShow.Refresh();
                });

                break;
            }
        }