1
我打形式的本地URL返回FALSE Global.asax文件,并随后使用做的东西,如果它是一个aspx文件(只有一个aspx文件):HttpContext.Current.Request.Url.IsFile当链接ASPX页面
HttpContext.Current.Request.Url.IsFile
它始终解析为false
不过,我不知道为什么。我完全global.asax
代码:
if(HttpContext.Current.Request.Url.IsFile)
{
if(File.Exists(HttpContext.Current.Request.Url.LocalPath))
{
if(new FileInfo(HttpContext.Current.Request.Url.LocalPath).Extension.Equals("aspx"))
{
DoSomethingWithThePagesURL();
}
}
}
看看这里一些有用的东西.. http://wdevs.blogspot.com/2009/03/url-properties-of-request-to-aspnet.html – MethodMan 2014-12-04 23:05:15