没有合适的资源?快使用搜索试试~ 我知道了~
在很多时候上传、下载时需要我们获取文件的根路径,此方法教大家如何实现需求。
资源推荐
资源详情
资源评论
ASP.NET 根路径的获取
private string _ApplicationPath;
/// <summary>
/// 虚拟应用程序根路径
/// </summary>
public string ApplicationPath
{
get
{
_ApplicationPath = HttpContext.Current.Request.ApplicationPath;
if (_ApplicationPath.Length == 1)
{
_Applicati;
}
return _ApplicationPath;
}
}
private string _CurrentPath;
/// <summary>
/// 当前的绝对路径
/// </summary>
public string CurrentPath
{
get
{
_CurrentPath = HttpContext.Current.Server.MapPath(".").ToLower();//当前的绝对路径
if (_CurrentPath.Length == 1)
{
_CurrentPath = "";
}
private string _ApplicationPath;
/// <summary>
/// 虚拟应用程序根路径
/// </summary>
public string ApplicationPath
{
get
{
_ApplicationPath = HttpContext.Current.Request.ApplicationPath;
if (_ApplicationPath.Length == 1)
{
_Applicati;
}
return _ApplicationPath;
}
}
private string _CurrentPath;
/// <summary>
/// 当前的绝对路径
/// </summary>
public string CurrentPath
{
get
{
_CurrentPath = HttpContext.Current.Server.MapPath(".").ToLower();//当前的绝对路径
if (_CurrentPath.Length == 1)
{
_CurrentPath = "";
}
资源评论
LiCHuanCHeng
- 粉丝: 2
- 资源: 31
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功