C#的WebBrowser控制浏览

简介:


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace openUrl
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            string add = "";
            if (!(txtUrl.Text.Trim().StartsWith("http://")))
            {
                add = "http://" + txtUrl.Text.Trim();
                txtUrl.Text = add;
            }
            webBrowser1.Url = new Uri(add);
        }
    }
}


版权声明:本文博主原创文章。博客,未经同意,不得转载。







本文转自mfrbuaa博客园博客,原文链接:http://www.cnblogs.com/mfrbuaa/p/4757804.html,如需转载请自行联系原作者


相关文章
|
9月前
|
JavaScript 前端开发 C#
C# webbrowser控件设置代理IP访问网站
C# webbrowser控件设置代理IP访问网站
459 5
|
Web App开发 数据采集 测试技术
使用Selenium和代理用户名和密码在C#中进行无头浏览
Selenium是一个自动化测试工具,可以模拟用户在浏览器中的操作。在C#中使用Selenium和爬虫代理加强版IP的时候,因为代理服务器需要用户名和密码进行认证,Chrome浏览器会弹出一个认证窗口要求输入用户名和密码。可以创建一个Chrome扩展插件,然后加载使用完成自动认证窗口。
354 0
使用Selenium和代理用户名和密码在C#中进行无头浏览
|
JavaScript C# 前端开发
c#控制IE浏览器自动点击等事件WebBrowser,mshtml.IHTMLDocument2
原文:c#控制IE浏览器自动点击等事件WebBrowser,mshtml.IHTMLDocument2 可以实现例如通过应用程序操作google搜索,用户输入要搜索的内容,然后在google中搜索;可以自动点击网页上的按钮等功能     1.
2569 0
c# WebBrowser 操作
使用:http://wenku.baidu.com/view/511d37faf705cc17552709d4.html  (含验证码,点击等) 用法 :http://wenku.baidu.com/view/4efa281a6bd97f192279e9f0.html
494 0