当前的.服务器. MapPath [英] Current. Server. MapPath

查看:63
本文介绍了当前的.服务器. MapPath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我下面一行中的〜"是什么意思吗?

HttpContext.Current.Server.MapPath(〜")+"//Error.log";

Hi can somebody tell me what is the use of "~" in the line below ?

HttpContext.Current.Server.MapPath("~") + "//Error.log";

推荐答案

波浪号表示相对于虚拟路径名的根路径名到网站根目录.请参阅:
http://forums.asp.net/t/1174329.aspx/1 [ ^ ],
http://www.dotnetperls.com/mappath [ http://msdn.microsoft.com/en-us/library/system. web.httpserverutility.mappath.aspx [ ^ ].

—SA
Tilde indicates the root path name in a virtual path name relative to the Web site root. Please see:
http://forums.asp.net/t/1174329.aspx/1[^],
http://www.dotnetperls.com/mappath[^],
http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath.aspx[^].

—SA


这篇关于当前的.服务器. MapPath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆