https://github.com/sepppenner/googledriveexample
GoogleDriveExample is an assembly/ library on how to work with the Google.Apis.Drive.v3.dll.
https://github.com/sepppenner/googledriveexample
Last synced: 8 months ago
JSON representation
GoogleDriveExample is an assembly/ library on how to work with the Google.Apis.Drive.v3.dll.
- Host: GitHub
- URL: https://github.com/sepppenner/googledriveexample
- Owner: SeppPenner
- License: mit
- Created: 2017-05-15T12:15:11.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2025-01-07T17:40:38.000Z (over 1 year ago)
- Last Synced: 2025-04-02T00:24:44.980Z (about 1 year ago)
- Language: C#
- Homepage:
- Size: 145 KB
- Stars: 6
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: License.txt
Awesome Lists containing this project
README
GoogleDriveExample
====================================
GoogleDriveExample is an assembly/ library on how to work with the Google.Apis.Drive.v3.dll.
[](https://ci.appveyor.com/project/SeppPenner/googledriveexample)
[](https://github.com/SeppPenner/GoogleDriveExample/issues)
[](https://github.com/SeppPenner/GoogleDriveExample/network)
[](https://github.com/SeppPenner/GoogleDriveExample/stargazers)
[](https://raw.githubusercontent.com/SeppPenner/GoogleDriveExample/master/License.txt)
[](https://snyk.io/test/github/SeppPenner/GoogleDriveExample)
[](https://franzhuber23.blogspot.de/)
[](https://patreon.com/SeppPennerOpenSourceDevelopment)
[](https://paypal.me/th070795)
## Basic usage
```csharp
public void Test()
{
ICustomGDriveService _service = new CustomGDriveService();
_service.xy //See the interface section for more information
}
```
## Interface ICustomGDriveService
```csharp
using System;
using Google.Apis.Drive.v3;
using GoogleDriveExample.Implementation;
namespace GoogleDriveExample.Interfaces
{
///
/// The Google class
///
public interface ICustomGDriveService
{
///
/// Gets the used quota of the account
///
/// The that is needed
/// The used quota of the account
long GetQuotaUsed(DriveService service);
///
/// Gets the total quota (is 15 GB) of the account
///
/// The that is needed
/// The total quota of the account
long GetQuotaTotal(DriveService service);
///
/// Uploads a file to GDrive with "everone that has the link can read the file" rights
///
/// The that is needed
/// The File that should be uploaded
/// The parent folder
/// The download link to the file
string UploadToGDrive(DriveService service, string uploadFile, string parent);
///
/// Gets the root folder id of the account
///
/// The that is needed
/// The root folder id for the account
string GetRootFolderId(DriveService service);
///
/// Gets the needed in the methods above
///
/// The client id that needs to be set inside the Google account (API-Key)
/// The client secret/ password
/// The client username
/// The needed to authenticate the above methods
DriveService GetDriveService(string clientId, string clientSecret, string userName);
///
/// Called when the upload process is changed
///
event EventHandler OnUploadProgessChanged;
///
/// Called when the upload process is finished
///
event EventHandler OnUploadSuccessfull;
}
}
```
Change history
--------------
See the [Changelog](https://github.com/SeppPenner/GoogleDriveExample/blob/master/Changelog.md).