Snippets Collections
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);
    }

}
star

Wed Jun 23 2021 05:32:19 GMT+0000 (UTC)

#c# #nextcloud #asp.net #webdav

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension