C# CODE:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
public void Tourl(string urlstr)
{string[] searchurl = HttpContext.Current.Request.Url.AbsoluteUri.Split('/');
string url = "http:/";
for (int i = 1; i <= searchurl.Length - 2; i++)
{
url += searchurl[i] + "/";
}
//跳转语句
HttpContext.Current.Response.Redirect(url + urlstr, false);}