飞鸽传书,去看了下WEBBROWSER的资料,首先要建立一个桌面应用程序,然后拖一个webbrowser控件上去;接下来,就可以在后台添加相关代码。
首先我们还是把需要用到的控件加上去吧,喜欢的话,你也可以直接在设计界面拖进来。
加上控件之后我们顺便把要执行的事件都注册下。下面是代码:  处于工作需要,可以从通过输入的网站获得自己想要的数据了。

private MenuStrip menuStrip1;
        private ToolStripMenuItem fileToolStripMenuItem,
            saveAsToolStripMenuItem, printToolStripMenuItem,
            printPreviewToolStripMenuItem, exitToolStripMenuItem,
            pageSetupToolStripMenuItem, propertiesToolStripMenuItem;
        private ToolStripSeparator toolStripSeparator1, toolStripSeparator2;

private ToolStrip toolStrip1, toolStrip2;// 飞鸽传书
        private ToolStripTextBox toolStripTextBox1;
        private ToolStripButton goButton, backButton,
            forwardButton, stopButton, refreshButton,
            homeButton, searchButton, printButton,sourceButton,formatButton;

private StatusStrip statusStrip1;
        private ToolStripStatusLabel toolStripStatusLabel1;

private void InitializeForm()
        {
            webBrowser1 = new WebBrowser();

menuStrip1 = new MenuStrip();
            fileToolStripMenuItem = new ToolStripMenuItem();
            saveAsToolStripMenuItem = new ToolStripMenuItem();
            toolStripSeparator1 = new ToolStripSeparator();
            printToolStripMenuItem = new ToolStripMenuItem();
            printPreviewToolStripMenuItem = new ToolStripMenuItem();
            toolStripSeparator2 = new ToolStripSeparator();
            exitToolStripMenuItem = new ToolStripMenuItem();
            pageSetupToolStripMenuItem = new ToolStripMenuItem();
            propertiesToolStripMenuItem = new ToolStripMenuItem();

toolStrip1 = new ToolStrip();
            goButton = new ToolStripButton();
            backButton = new ToolStripButton();
            forwardButton = new ToolStripButton();
            stopButton = new ToolStripButton();
            refreshButton = new ToolStripButton();
            homeButton = new ToolStripButton();
            searchButton = new ToolStripButton();
            printButton = new ToolStripButton();
            sourceButton = new ToolStripButton();
            formatButton = new ToolStripButton();

toolStrip2 = new ToolStrip();
            toolStripTextBox1 = new ToolStripTextBox();

statusStrip1 = new StatusStrip();
            toolStripStatusLabel1 = new ToolStripStatusLabel();

menuStrip1.Items.Add(fileToolStripMenuItem);

fileToolStripMenuItem.DropDownItems.AddRange(
                new ToolStripItem[] {
                saveAsToolStripMenuItem, toolStripSeparator1,
                pageSetupToolStripMenuItem, printToolStripMenuItem,
                printPreviewToolStripMenuItem, toolStripSeparator2,
                propertiesToolStripMenuItem, exitToolStripMenuItem
            });

fileToolStripMenuItem.Text = "&File";
            saveAsToolStripMenuItem.Text = "Save &As...";
            pageSetupToolStripMenuItem.Text = "Page Set&up...";
            printToolStripMenuItem.Text = "&Print...";
            printPreviewToolStripMenuItem.Text = "Print Pre&view...";
            propertiesToolStripMenuItem.Text = "Properties";
            exitToolStripMenuItem.Text = "E&xit";

printToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.P;

saveAsToolStripMenuItem.Click +=
                new System.EventHandler(saveAsToolStripMenuItem_Click);
            pageSetupToolStripMenuItem.Click +=
                new System.EventHandler(pageSetupToolStripMenuItem_Click);
            printToolStripMenuItem.Click +=
                new System.EventHandler(printToolStripMenuItem_Click);
            printPreviewToolStripMenuItem.Click +=
                new System.EventHandler(printPreviewToolStripMenuItem_Click);
            propertiesToolStripMenuItem.Click +=
                new System.EventHandler(propertiesToolStripMenuItem_Click);
            exitToolStripMenuItem.Click +=
                new System.EventHandler(exitToolStripMenuItem_Click);

toolStrip1.Items.AddRange(new ToolStripItem[] {
            goButton, backButton, forwardButton, stopButton,
            refreshButton, homeButton, searchButton, printButton,sourceButton,formatButton});

goButton.Text = "Go";
            backButton.Text = "Back";
            forwardButton.Text = "Forward";
            stopButton.Text = "Stop";
            refreshButton.Text = "Refresh";
            homeButton.Text = "Home";
            searchButton.Text = "Search";
            printButton.Text = "Print";
            sourceButton.Text = "Source";
            formatButton.Text = "Format Source";

backButton.Enabled = false;
            forwardButton.Enabled = false;

goButton.Click += new System.EventHandler(goButton_Click);
            backButton.Click += new System.EventHandler(backButton_Click);
            forwardButton.Click += new System.EventHandler(forwardButton_Click);
            stopButton.Click += new System.EventHandler(stopButton_Click);
            refreshButton.Click += new System.EventHandler(refreshButton_Click);
            homeButton.Click += new System.EventHandler(homeButton_Click);
            searchButton.Click += new System.EventHandler(searchButton_Click);
            printButton.Click += new System.EventHandler(printButton_Click);
            sourceButton.Click += new EventHandler(sourceButton_Click);
            formatButton.Click += new EventHandler(formatButton_Click);

toolStrip2.Items.Add(toolStripTextBox1);
            toolStripTextBox1.Size = new System.Drawing.Size(250, 25);
            toolStripTextBox1.KeyDown +=
                new KeyEventHandler(toolStripTextBox1_KeyDown);
            toolStripTextBox1.Click +=
                new System.EventHandler(toolStripTextBox1_Click);

statusStrip1.Items.Add(toolStripStatusLabel1);

webBrowser1.Dock = DockStyle.Fill;
            webBrowser1.Navigated +=
                new WebBrowserNavigatedEventHandler(webBrowser1_Navigated);

Controls.AddRange(new Control[] {
            webBrowser1, toolStrip2, toolStrip1,
            menuStrip1, statusStrip1, menuStrip1 });
        }

然后我们来执行这些事件:

// Displays the Save dialog box.
        private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            webBrowser1.ShowSaveAsDialog();
        }

// Displays the Page Setup dialog box.
        private void pageSetupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            webBrowser1.ShowPageSetupDialog();
        }

// Displays the Print dialog box.
        private void printToolStripMenuItem_Click(object sender, EventArgs e)
        {
            webBrowser1.ShowPrintDialog();
        }

// Displays the Print Preview dialog box.
        private void printPreviewToolStripMenuItem_Click(
            object sender, EventArgs e)
        {
            webBrowser1.ShowPrintPreviewDialog();
        }

// Displays the Properties dialog box.
        private void propertiesToolStripMenuItem_Click(
            object sender, EventArgs e)
        {
            webBrowser1.ShowPropertiesDialog();
        }

// Selects all the text in the text box when the user clicks it.
        private void toolStripTextBox1_Click(object sender, EventArgs e)
        {
            toolStripTextBox1.SelectAll();
        }

// Navigates to the URL in the address box when
        // the ENTER key is pressed while the ToolStripTextBox has focus.
        private void toolStripTextBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                Navigate(toolStripTextBox1.Text);
            }
        }

// Navigates to the URL in the address box when
        // the Go button is clicked.
        private void goButton_Click(object sender, EventArgs e)
        {
            Navigate(toolStripTextBox1.Text);
        }

// Navigates to the given URL if it is valid.
        private void Navigate(String address)
        {
            if (String.IsNullOrEmpty(address)) return;
            if (address.Equals("about:blank")) return;
            if (!address.StartsWith("http://") &&
                !address.StartsWith("https://"))
            {
                address = "http://" + address;
            }
            try
            {
                webBrowser1.Navigate(new Uri(address));
            }
            catch (System.UriFormatException)
            {
                return;
            }
        }

// Updates the URL in TextBoxAddress upon navigation.
        private void webBrowser1_Navigated(object sender,
            WebBrowserNavigatedEventArgs e)
        {
            toolStripTextBox1.Text = webBrowser1.Url.ToString();
        }

// Navigates webBrowser1 to the previous page in the history.
        private void backButton_Click(object sender, EventArgs e)
        {
            webBrowser1.GoBack();
        }

// Disables the Back button at the beginning of the navigation history.
        private void webBrowser1_CanGoBackChanged(object sender, EventArgs e)
        {
            backButton.Enabled = webBrowser1.CanGoBack;
        }

// Navigates webBrowser1 to the next page in history.
        private void forwardButton_Click(object sender, EventArgs e)
        {
            webBrowser1.GoForward();
        }

// Disables the Forward button at the end of navigation history.
        private void webBrowser1_CanGoForwardChanged(object sender, EventArgs e)
        {
            forwardButton.Enabled = webBrowser1.CanGoForward;
        }

// Halts the current navigation and any sounds or animations on
        // the page.
        private void stopButton_Click(object sender, EventArgs e)
        {
            webBrowser1.Stop();
        }

// Reloads the current page.
        private void refreshButton_Click(object sender, EventArgs e)
        {
            // Skip refresh if about:blank is loaded to avoid removing
            // content specified by the DocumentText property.
            if (!webBrowser1.Url.Equals("about:blank"))
            {
                webBrowser1.Refresh();
            }
        }

// Navigates webBrowser1 to the home page of the current user.
        private void homeButton_Click(object sender, EventArgs e)
        {
            webBrowser1.GoHome();
        }

// Navigates webBrowser1 to the search page of the current user.
        private void searchButton_Click(object sender, EventArgs e)
        {
            webBrowser1.GoSearch();
        }

// Prints the current document using the current print settings.
        private void printButton_Click(object sender, EventArgs e)
        {
            webBrowser1.Print();
        }

// Updates the status bar with the current browser status text.
        private void webBrowser1_StatusTextChanged(object sender, EventArgs e)
        {
            toolStripStatusLabel1.Text = webBrowser1.StatusText;
        }

// Updates the title bar with the current document title.
        private void webBrowser1_DocumentTitleChanged(object sender, EventArgs e)
        {
            this.Text = webBrowser1.DocumentTitle;
        }

// Exits the application.
        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

其实我们现在就可以通过该控件浏览网页

飞鸽传书,去看了下WEBBROWSER的资料相关推荐

  1. 飞鸽传书如何在VMware下进行通信

    飞鸽传书如何在VMware下进行通信?VMware Workstation是一款功能强大的虚拟机软件,可以使你在一台机器上同时运行二个或更多Windows.DOS.LINUX系统,并进行开发.测试.部 ...

  2. 飞鸽传书linux运行,Linux下如何安装IPtux飞鸽传书

    习惯了在Windows系统中使用飞鸽传书的童鞋们,对于突然在使用Linux时在局域网下传输文件.即时通讯等,可能突然感觉束手无策. 下面就针对Linux下安装iptux(飞鸽传书)进行安装和使用的说明 ...

  3. 飞鸽传书 linux安装,linux下飞鸽传书,ipmsg的安装

    一.下载"飞鸽传书": 二.解压: tar zxvf g2ipmsg-0.9.5.tar.gz cd g2ipmsg-0.9.5 三.修改参数,使它支持中文名文件的传输 #以下几行 ...

  4. Linux飞鸽传书源码,Linux下的飞鸽传书

    202.106.74.* 于 2007-07-25 17:25:33发表: [root@DevHost g2ipmsg-0.8.6]# make make all-recursive make[1]: ...

  5. 飞鸽传书认证是互联网界具有极大声望

    飞鸽传书认证是互联网界具有极大声望的网络技能认证.其总体认证体系包括路由和交换网络支持(售后工程师认证体系),路由和交换网络设计(售前工程师认证体系)和广域网交换网络设计和支持几大部分.飞鸽传书201 ...

  6. Linux下飞鸽传书项目设计书,Linux 下飞鸽传书设计实现

    Linux 下飞鸽传书设计实现 1.系统功能 根据飞鸽传书协议在 linux 下实现飞鸽传输程序,并且与 windows 下飞鸽兼容.具体功能模块包括用户上线,下线,刷新查看在线用户,收发消息,传送文 ...

  7. 飞鸽传书创造出自己的一片天吧

    今天的只要功夫深的飞鸽传书,创造出自己的一片天吧,踩在柔软的沙滩上快乐地同大海舞蹈,枯黄的叶子被露水湿润后,多么地自由自在呀,我渴望高中三年与大家同甘共苦,我拿了个巧克力味的,非常惹人喜爱,尊敬的飞鸽 ...

  8. 今天的被子照样不叠的飞鸽传书

    被子照样不叠的飞鸽传书 今天的被子照样不叠的飞鸽传书,妈妈带我来到江东眼科医院,怎么了,我学习了季羡林爷爷的飞鸽传书怀念母亲这篇课文,如果一个人用喷头洗澡10分钟,我感到十分快乐,那一个人,好不容易叫 ...

  9. 解散等内容的飞鸽传书

    FreeEIM 企业即时通讯软件源代码2010年8月份最新版 作者: mynote - 日期:2010-10-12 浏览 83 次 FreeEIM 不同于传统的C/S 模式(Client/Server ...

最新文章

  1. hadoop job 未跑满资源_2018年第26周-解剖MapReduce Job
  2. Function Component 与 Class Component 有何不同?
  3. php接口图片转二进制,怎么在php项目中对图片进行二进制转换
  4. I - Washing clothes
  5. 关于向MySQL插入一条新纪录的问题
  6. [NOIP2003] 提高组 洛谷P1041 传染病控制
  7. [C#]结构体和字节数组的相互转化
  8. C#积木游戏(改编自DevExpress GridTetris)
  9. Android 签名类型
  10. 搭建影视APP需要准备的工具
  11. 【C语言每日练习】——3.回文数、特殊回文数(三种方法详解)
  12. 迷茫时代的明白人——书摘
  13. System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in us
  14. C#数据结构与算法总结
  15. 免费在线使用微软文字转语音工具(附详细转换步骤)
  16. 渗透测试 | IP信息收集
  17. Aspose.Slides使用教程:使用 C# 在 PowerPoint 演示文稿中添加页眉和页脚
  18. 矩阵求逆引理(Matrix Inversion Lemma)的意义
  19. linux基础 linux命令跟踪 strace命令
  20. vue3.0为什么要用Proxy替代defineProperty

热门文章

  1. 大数据技术之kafka (第 3 章 Kafka 架构深入) 分区策略在分析
  2. 最优化学习笔记(二十)——全局搜索算法
  3. 2021国潮新消费产业洞察报告
  4. 做产品经理的第1年、第5年和第10年...
  5. stm32f407 tim4 复用_波分复用对比,CWDM、DWDM、CCWDM有何不同?
  6. 【计算机科学基础】透明性
  7. 【数据结构与算法】二项队列的Java实现
  8. php性能优化 --- laravel 性能优化
  9. Django框架 之 Ajax
  10. 【微信小程序】初识小程序