//asp.net用UTF-8模式,百度中心用GB2312格式
//转换为GB2312
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
if (txtSearch.Text.Trim() != null) //去除两边空白
{
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); // 转换编码格式
Response.Redirect("http://www.baidu.com/s?wd="+Server.UrlEncode(txtSearch.Text)); // 跳转到百度
}