server.mappath()获取本机绝对路径

server.mappath()获取本机绝对路径

ID:18424006

大小:124.00 KB

页数:7页

时间:2018-09-17

server.mappath()获取本机绝对路径_第1页
server.mappath()获取本机绝对路径_第2页
server.mappath()获取本机绝对路径_第3页
server.mappath()获取本机绝对路径_第4页
server.mappath()获取本机绝对路径_第5页
资源描述:

《server.mappath()获取本机绝对路径》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、Server.MapPath()获取本机绝对路径1.Server.MapPath("/") 应用程序根目录所在的位置如C:Inetpubwwwroot2.Server.MapPath("./") 表示所在页面的当前目录   注:等价于Server.MapPath("") 返回Server.MapPath("")所在页面的物理文件路径3.Server.MapPath("../")表示上一级目录4.Server.MapPath("~/")表示当前应用级程序的目录,如果是根目录,就是根目录,如果是虚拟目录,就是

2、虚拟目录所在的位置如:C:InetpubwwwrootExample注:等效于Server.MapPath("~")。不知道是否正确,研究中......另:以下几句等效Java代码1.string filename=Server.MapPath("./") + @"Web.config";  2.string filename=Server.MapPath("./") + "/Web.config";  3.string filename=Server.MapPath("") + @"Web.con

3、fig"  stringfilename=Server.MapPath("./")+@"Web.config";stringfilename=Server.MapPath("./")+"/Web.config";stringfilename=Server.MapPath("")+@"Web.config" 附一例子:修改web.config的某一节点的属性值Java代码1.public void write()  2.        {  3.            string key1 = this.T

4、extBox1.Text;  4.            DataSet ds = new DataSet();  5.            ds.ReadXml(Server.MapPath("")+"/web.config");  6.            // 不是Tables[0]  7.            ds.Tables[1].Rows[0][1] = key1;  8.            ds.AcceptChanges();  9.            ds.WriteXml(S

5、erver.MapPath("")+"/web.config");  10.            ds.Dispose();  11.              12.        }  publicvoidwrite(){stringkey1=this.TextBox1.Text;DataSetds=newDataSet();ds.ReadXml(Server.MapPath("")+"/web.config");//不是Tables[0]ds.Tables[1].Rows[0][1]=key1;ds.A

6、cceptChanges();ds.WriteXml(Server.MapPath("")+"/web.config");ds.Dispose();} beconsistentwithinthesamedisk.Alternateunifiedcorerequirementsplacedontheterminalstripterminals,onlineidentityandensurethecoppercoreisnotexposed.6.4.6enclosurewithinthesametothecable

7、coreprovidesbindingintoacircle,harnesstiespacingisgenerally100mm;branchofficesshallbebindingonbothends,eachcore转自:http://blog.tianya.cn/blogger/post_show.asp?BlogID=284576&PostID=3517248作者:山谷银月stringServer.MapPath(stringpath)返回与Web服务器上的指定虚拟路径相对应的物理文件路径。

8、Html代码1.<%=Server.MapPath(Request.ServerVariables["PATH_INFO"])%>  2.  3.<%= Server.MapPath("/")%>  4.<%= Server.MapPath("")%>  5.<%=Server.MapPath(".")%>  6.  7.<%= Server.MapPath("../

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。