ListSharedDrives Method

Lists shared drives that the current user is a member of.

Syntax

int ListSharedDrives();

Remarks

This method lists the shared drives which the current user is a member of.

Calling this method will fire the SharedDriveList event once for each shared drive, and will also populate the SharedDrive* properties.

If there are still more shared drives available to list when this method returns, the SharedDriveMarker property will be populated. Continue to call this method until SharedDriveMarker is empty to accumulate all pages of results in the SharedDrive* properties.

// SharedDriveList event handler.
googledrive.OnSharedDriveList += (s, e) => {
  Console.WriteLine(e.Name);
};

// List all shared drives the current user is a member of.
do {
  googledrive.ListSharedDrives();

  for (int i = 0; i < googledrive.SharedDrives.Count; i++) {
    // Process shared drives here.
  }
} while (!string.IsNullOrEmpty(googledrive.SharedDriveMarker));

Error Handling

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

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