2
在asp.net MVC應用程序我有一個這樣的代碼:爲什麼HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath在不同的服務器上有所不同?
var p = HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath;
if (p.EndsWith("Login.aspx")) return;
這個代碼在Application_AuthenticateRequest
方法每個請求執行。問題是,在另一臺計算機上,p是~/Login.aspx
和~/Login.aspx/LoginUser
。該請求發送至~/Login.aspx/LoginUser
。爲什麼行爲不同?