/// <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); } }
/// <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; } }