OAuth 2.0

C# 使用 Google API 處理 Google 雲端硬碟(下)-程式篇

相關權限設定請看:C# 使用 Google API 處理 Google 雲端硬碟(上)-設定篇

 

寫了一個程式,測試一堆功能,界面如下。

 

image

 

放大左邊的界面

 

image

 

底下的程式不一一說明程式的運作,只列出各功能的副程式。

 

基本說明

 

在 Google Drive 架構中,目錄與檔案都是 File 物件。

 

目錄的 MimeType 必為 "application/vnd.google-apps.folder"。

 

目錄與檔案都有一個 id,不管目錄檔案改名或移動位置,id 是固定不變的。在同一目錄下,允許同名的檔案或目錄,因為主要的區別是 id。


 

重要度:
文章分類:

C# 使用 Google API 處理 Google 雲端硬碟(上)-設定篇

參考資料

 

使用 OAuth 2.0 存取 Google API

https://developers.google.com/identity/protocols/oauth2?hl=zh-tw

 

透過 .NET 輕鬆存取 Google API

https://developers.google.com/api-client-library/dotnet?hl=zh-tw

 

Drive API

https://developers.google.com/drive/?hl=zh-tw

 

Namespace Google.Apis.Drive.v3

https://googleapis.dev/dotnet/Google.Apis.Drive.v3/latest/api/Google.Apis.Drive.v3.html

 

取得憑證

 

註冊並登錄 https://console.cloud.google.com/

 

左上角下拉專案

 

image


 

點選「新增專案」

 

image



 

建立專案名稱

 

image

 

 

重要度:
文章分類:
借我放一下廣告
訂閱 OAuth 2.0