private async void createNeedFolders(DropboxApi api, System.Collections.Specialized.StringCollection buf) { var files = await client.viewFilesAsync(api, ""); bool flag = false; for (int i = 0; i < buf.Count; i++) { string tmp = "/" + buf[i].Split('\\').Last(); foreach (var file in files.Contents) { if (file.Path == tmp) { flag = true; } } if (flag == false) { var fol = await client.createFolderAsync(api, tmp /*"/" + buf[i].Split('\\').Last()*/ /*nameFolder + "/" + name*/); } flag = false; } }