标题 | asp.net获取网站目录物理路径示例 |
内容 | 这篇文章主要介绍了asp.net获取网站目录物理路径的方法,需要的朋友可以参考下页面后台cs文件的相对网站根目录的路径/view/Atlas 代码如下: string rootPath1= Server.MapPath("~"); string rootPath2 = Request.ApplicationPath; string path1 = Server.MapPath("upload"); string path2 = Server.MapPath(""); string path3 = Server.MapPath("."); string path4 = Server.MapPath(".."); string path5 = Server.MapPath(Request.ServerVariables["PATH_INFO"]); 结果 代码如下: string rootpath1= "F:ASP.NET_Projects超凡装饰cfzsWebcfzsWeb"; string rootpath2= "/Web"; string path1 = "F:ASP.NET_Projects超凡装饰cfzsWebviewAtlasuploadcfzsWebviewAtlasupload"; string path2 = "F:ASP.NET_Projects超凡装饰cfzsWebviewAtlascfzsWebviewAtlas"; string path3 = "F:ASP.NET_Projects超凡装饰cfzsWebviewAtlascfzsWebviewAtlas"; string path4 = "F:ASP.NET_Projects超凡装饰cfzsWebviewcfzsWebview"; string path5 = "F:ASP.NET_Projects超凡装饰cfzsWebviewAtlasAdd.aspxcfzsWebviewAtlasAdd.aspx"; |
随便看 |
|
在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。