浏览器控件webBrowser

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

namespace 浏览器控件
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            string text = textBox1.Text;
            Uri uri = new Uri("http://"+text);//默认要加http://才可以用
            webBrowser1.Url = uri;
        }
    }
}

 url属性

posted @ 2021-08-21 17:09  静态类  阅读(158)  评论(0编辑  收藏  举报