public static async void downloadAllFiles() { var credentials = new NetworkCredential("USERNAME", "PASSWORD"); var webDavSession = new WebDavSession(@"https://cp.DOMAIN/remote.php/dav/files/USERNAME/", credentials); var items = await webDavSession.ListAsync(@"APK-Test/"); foreach (var item in items) { //await webDavSession.DownloadFileAsync(item.Uri, STREAM); WebClient myWebClient = new WebClient(); myWebClient.Credentials = credentials; myWebClient.DownloadFile(item.Uri, @"C:\temp" + item.Name); Console.WriteLine(item.Name); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter