小编Ste*_*eve的帖子

为什么这只能搜索Google?

它会跳过导航到有效网址并直接进入Google搜索.如果我在文本框中输入"stackoverflow.com",谷歌将搜索"stackoverflow.com".

private void button1_Click(object sender, EventArgs e)
{
    webBrowser1.Navigate(textBox1.Text); //navigates to url in textbox

    if (!textBox1.Text.StartsWith("http://"))
    {
        webBrowser1.Navigate("http://www.google.ie/search?q=" + (textBox1.Text));
    }
}
Run Code Online (Sandbox Code Playgroud)

c# webbrowser-control

-3
推荐指数
1
解决办法
160
查看次数

标签 统计

c# ×1

webbrowser-control ×1