コード例 #1
0
        /// <summary>
        /// Delete a directory
        /// </summary>
        /// <param name="directory">The name of the directory to be deleted</param>
        /// <returns>True if successful. False if not. Any exceptions are thrown.</returns>
        public bool DeleteDirectory(string directory)
        {
            if (FileShare == null)
            {
                throw new Exception("Cannot make Azure directory: " + directory + " (null share).");
            }

            // Get a reference to the directory.
            Directory = FileShare.GetDirectoryClient(directory);

            // Ensure that the directory exists.
            if (!Directory.Exists())
            {
                throw new Exception("Cannot delete Azure directory: " + directory + " - it doesn't exist.");
            }
            else
            {
                Directory.Delete();
            }
            return(true);
        }