示例#1
0
 /// <summary>
 /// 将文件的URL路径转换为物理路径
 /// </summary>
 /// <param name="path">URL路径</param>
 /// <returns></returns>
 private static string MapPath(string path)
 {
     if (path.StartsWith("..") || path.StartsWith("~/") || path.StartsWith("/"))
     {
         return(ALHttpIO.MapPath(path));
     }
     else
     {
         return(path);
     }
 }
示例#2
0
        /// <summary>
        /// 根据相对路径(结合绝对地址),获取物理路径
        /// </summary>
        /// <param name="path">相对路径</param>
        /// <returns></returns>
        protected string MapPath(string path)
        {
            switch (this._mode)
            {
            case 0:
            case 1:
                return(ALHttpIO.MapPath(path, _dirPath));

            case 2:
                return(HttpContext.Current.Server.MapPath(path));

            default:
                return(path);
            }
        }
示例#3
0
 /// <summary>
 /// 用于存储到硬盘的构造函数
 /// </summary>
 public BiAttachHelper(string filePath, int mode)
 {
     this._dirPath  = ALHttpIO.MapPath("~/");
     this._filePath = filePath;
     this._mode     = mode;
 }