private string GetBaseURL()//这个函数可以得到http://localhost/
{
if (HttpContext.Current.Request.ApplicationPath == "/")
{
return @"http://" + HttpContext.Current.Request.Url.Host;
}
else
{
return @"http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath;
}
}
{
if (HttpContext.Current.Request.ApplicationPath == "/")
{
return @"http://" + HttpContext.Current.Request.Url.Host;
}
else
{
return @"http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath;
}
}