示例#1
0
        public static string GetFullPath <T1, T2>(string fileStorageName, FilePathScheme scheme, T1 paramPath, T2 paramFile, string paramExt)
        {
            string result = GetRootPath(fileStorageName, scheme);

            result = Path.Combine(result, GetRelativePath <T1>(fileStorageName, paramPath));
            result = Path.Combine(result, GetFileName <T2>(fileStorageName, paramFile, paramExt));

            return(new Uri(result).ToString());
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="rootID">文件根编号</param>
        /// <param name="scheme">文件存储类型</param>
        /// <returns></returns>
        public static string GetRootPath(int rootID, FilePathScheme scheme)
        {
            var fileRoot = FileManagementConfig.FileRoots.FirstOrDefault(a => a.ID == rootID);

            if (fileRoot != null)
            {
                return(fileRoot.GetPath(scheme));
            }
            return("");
        }
示例#3
0
        public string GetPath(FilePathScheme scheme)
        {
            switch (scheme)
            {
            case FilePathScheme.Ftp:
                return(FtpPath);

            case FilePathScheme.Http:
                return(HttpPath);

            case FilePathScheme.MMS:
                return(MMSPath);

            case FilePathScheme.Physical:
                return(PhysicalPath);

            default:
                return("");
            }
        }
示例#4
0
 /// <summary>
 /// 返回文件根路径
 /// </summary>
 /// <param name="fileStorageName">文件存储名称</param>
 /// <param name="scheme">文件存储类型</param>
 /// <returns></returns>
 public static string GetRootPath(string fileStorageName, FilePathScheme scheme)
 {
     return(GetRootPath(GetRootID(fileStorageName), scheme));
 }