
其实也很简单,用到了ServerVariables集合
protected string GetVirtualPath()
{
string strServer = Convert.ToString(Request.ServerVariables["SERVER_NAME"]);
string strPort = Convert.ToString(Request.ServerVariables["SERVER_PORT"]);
string strRoot = Request.ApplicationPath;
if (strPort == "80")
strPort = "";
return string.Format("