设置完整虚拟路径

 

代码
   
     
// 路径访问绝对地址
string servername = HttpContext.Current.Request.ServerVariables[ " SERVER_NAME " ];
string port = HttpContext.Current.Request.ServerVariables[ " SERVER_PORT " ];
StringBuilder mHttpUrl
= new StringBuilder();
mHttpUrl.Append(
" http:// " );
mHttpUrl.Append(servername);
if (port.Length > 0 )
{
mHttpUrl.Append(
" : " );
mHttpUrl.Append(port);
}
string mServerName = " ~/AppModules/Archives/HTMLIMAGE/index.htm " ;
mHttpUrl.Append(
this .Page.ResolveUrl(mServerName));

 

你可能感兴趣的:(路径)