示例#1
0
        /// <summary>
        /// Combines FolderName and path.
        /// </summary>
        /// <param name="folderName">For example "Default/"</param>
        /// <param name="path">For example "/index.html"</param>
        /// <returns>Returns for example "Default/index.html"</returns>
        public static string FolderNameParse(string folderName, string path)
        {
            path = HttpUtility.UrlDecode(path); // For example "Hello%20World.pdf"
            string result = FolderNameParse(folderName);

            path = UtilFramework.StringEmpty(path);
            if (path.StartsWith("/") || path.StartsWith("\""))
            {
                path = path.Substring(1);
            }
            result += path;
            return(result);
        }
示例#2
0
 public static string FolderNameParse(string folderName)
 {
     if (UtilFramework.StringNull(folderName) == null)
     {
         return(null);
     }
     folderName = UtilFramework.StringEmpty(folderName);
     folderName = folderName.Replace(@"\", "/");
     if (folderName.StartsWith("/"))
     {
         folderName = folderName.Substring(1);
     }
     if (!folderName.EndsWith("/"))
     {
         folderName += "/";
     }
     return(folderName);
 }