vs.net 2005:(1) web 页面上放上一个文本框TextBox1,一个按钮Button1.
(2) 设置按钮事件:
protected void Button1_Click(object sender, EventArgs e)
{
string s1; s1 = "http://www.google.cn/search?complete=1&hl=zh-CN&q=" + this.TextBox1.Text.ToString().Trim() + "&meta=";
this.Response.Redirect(s1, true);
}
这样就可以用我们自己的界面,根据用户在我们自己的文本框中输入的内容去搜索 Google.
Baidu 方法类似.
(2) 设置按钮事件:
protected void Button1_Click(object sender, EventArgs e)
{
string s1; s1 = "http://www.google.cn/search?complete=1&hl=zh-CN&q=" + this.TextBox1.Text.ToString().Trim() + "&meta=";
this.Response.Redirect(s1, true);
}
这样就可以用我们自己的界面,根据用户在我们自己的文本框中输入的内容去搜索 Google.
Baidu 方法类似.
<table bgcolor="#FFFFFF"><tr><td>
<input name=tn type=hidden value=baidu>
<input type=text name=word size=30>
<input type="submit" value="搜索">
</td></tr></table>
</form>