Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dir"></param>
        public static string CreateDir(string dir)
        {
            if (string.IsNullOrEmpty(dir))
            {
                return("");
            }
            WebDAVFileServer fileService = GetWebDAVServer("");

            fileService.CreateDir(dir);
            return(dir);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="baseDir"></param>
        /// <param name="dir">4位年+2位月+2位日</param>
        public static string CreateDir(string baseDir, string dir)
        {
            if (string.IsNullOrEmpty(dir))
            {
                return("");
            }
            dir = string.Format("{0}/{1}/{2}/", dir.Substring(0, 4), dir.Substring(4, 2), dir.Substring(6, 2));
            WebDAVFileServer fileService = GetWebDAVServer("");

            string[] dirs = dir.Split('/');
            foreach (string d in dirs)
            {
                if (!string.IsNullOrEmpty(d))
                {
                    baseDir += d + "/";
                    fileService.CreateDir(baseDir);
                }
            }
            return(baseDir);
        }