Asp.NET獲取文件及其路徑

【相對路徑】
Request.ApplicationPath /src
Path.GetDirectoryName(HttpContext.Current.Request.RawUrl ) //src//Xiaoshe
Context.Request.Path /src/Xiaoshe/Xiaoshe_New.aspx
Context.Request.CurrentExecutionFilePath /src/Xiaoshe/Xiaoshe_New.aspx
Context.Request.FilePath /src/Xiaoshe/Xiaoshe_New.aspx
HttpContext.Current.Request.RawUrl  /src/Xiaoshe/Xiaoshe_New.aspx
HttpContext.Current.Request.Url http://localhost:1344/src/Xiaoshe/Xiaoshe_New.aspx
TemplateSourceDirectory /src/Controls
【絕對路徑】
Server.MapPath("./")  E://Wonsoft//Pro2//src//Xiaoshe//
Server.MapPath("")  E://Wonsoft//Pro2//src//Xiaoshe
Context.Request.PhysicalApplicationPath E://Wonsoft//Pro2//src//
Context.Request.PhysicalPath  E://Wonsoft//Pro2//src//Xiaoshe//Xiaoshe_New.aspx
MapPathSecure(TemplateSourceDirectory) E://Wonsoft//Pro2//src//Controls string
【其餘】
Control.ResolveClientUrl(string relativeUrl)
Control.ResolveUrl(string relativeUrl)
相關文章
相關標籤/搜索