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)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM