How can I upload a file to google drive, with given mail address, using C#?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Not sure what you meant by "upload with mail ID". For accessing a user's Google Drive, you'll have to receive an Access Token from Google for that particular account. This is done using the API.
The Access Token will be returned, upon receiving user's consent. This Access Token is used to send API requests. Learn more about Authorization
For a start, you have to enable your Drive API, register your project and obtain credentials from the Developer Console
You can then use the following code for receiving user's consent and obtaining an authenticated Drive Service
Following is a working piece of code for uploading to Drive.
Here's the little function for determining a file's MIME Type:
Source.
In addition to @NicoRiff's reference, you may also check this Uploading Files documentation. Here's a sample code:
You may also check on this tutorial.