IPWorks Cloud 2020 .NET Edition

Questions / Feedback?

ListDrives Method

Lists the drives accessible by the user.

Syntax

public void ListDrives();
Public Sub ListDrives()

Remarks

This method lists the drives accessible to the current user.

Calling this method will fire the DriveList event once for each drive, and will also populate the Drives collection.

If there are still more drives available to list when this method returns, the DriveMarker property will be populated. Continue to call this method until DriveMarker is empty to accumulate all pages of results in the Drives collection.

The ListDrivesScope configuration setting can be used to control which drives are listed; by default only drives the user directly owns are returned. Refer to ListDrivesScope for more information.

Note: For use-cases that only make use of the current user's default drive (e.g., when authenticated with a personal Microsoft account), there is no need to ever call ListDrives, set the Drive property, or use any of the component's other drive-related API members. By default, the Drive property and the GroupId and SiteId configuration settings are all empty, which causes the component to use the current user's default drive.

// DriveList event handler.
onedrive.OnDriveList += (s, e) => {
  Console.WriteLine(e.Name);
};

do {
  onedrive.ListDrives();

  for (int i = 0; i < onedrive.Drives.Count; i++) {
    // Process drives here.
  }
} while (!string.IsNullOrEmpty(onedrive.DriveMarker));

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 .NET Edition - Version 20.0 [Build 8265]