Ejemplo n.º 1
0
        /// <summary>
        /// Creates folder
        /// </summary>
        /// <param name="path">Path to the parent folder. Example: "/Contests/Active".
        /// The path is relevant to the root Dropbox folder - i.e. the path always starts with "/"
        /// </param>
        /// <returns>On success returns true, otherwise false.</returns>
        public static async Task <bool> CreateFolder(string path)
        {
            using (var dbx = new DropboxClient(DropboxAppAccessToken))
            {
                var  folderArg = new Dropbox.Api.Files.CreateFolderArg(path);
                bool success   = true;
                try
                {
                    var folder = await dbx.Files.CreateFolderAsync(folderArg);
                }
                catch (Exception)
                {
                    Console.WriteLine("Unable to create folder");
                    success = false;
                }

                return(success);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates folder 
        /// </summary>
        /// <param name="path">Path to the parent folder. Example: "/Contests/Active".
        /// The path is relevant to the root Dropbox folder - i.e. the path always starts with "/" 
        /// </param>
        /// <returns>On success returns true, otherwise false.</returns>
        public static async Task<bool> CreateFolder(string path)
        {
            using (var dbx = new DropboxClient(DropboxAppAccessToken))
            {
                var folderArg = new Dropbox.Api.Files.CreateFolderArg(path);
                bool success = true;
                try
                {
                    var folder = await dbx.Files.CreateFolderAsync(folderArg);
                }
                catch (Exception)
                {
                    Console.WriteLine("Unable to create folder");
                    success = false;
                }

                return success;
            }
        }