2013-05-14 59 views
0

我正在使用Google Drive的C#API V2,而且我似乎無法找到FilesResource.ListRequest.Fetch()方法...我發現FilesResource.ListRequest接口與google中描述的稍有不同驅動文檔,所以我想對它做了一些改變,但沒有反映在Web文檔中。任何人都知道我現在應該如何執行查詢?如何使用.NET Google Drive API執行查詢?

這就是我試圖運行:提前

public void SomeMethod(Settings settings) 
{ 
    var provider = new NativeApplicationClient(GoogleAuthenticationServer.Description, settings.ApiKey, settings.ApiSecret); 
    var auth = new OAuth2Authenticator<NativeApplicationClient>(provider, AuthProvider); 
    _driveService = new Google.Apis.Drive.v2.DriveService(new BaseClientService.Initializer {Authenticator = auth}); 

    var request = _driveService.Files.List(); 
    request.Q = "mimeType='application/vnd.google-apps.folder' and trashed=false"; 

    request.Fetch() // <-- This method does not exist! :/ 
} 

謝謝!

回答

2

使用execute()方法,而不是取指()

request.Execute() 
+0

截至2014年2月,.Execute方法似乎也從FilesResource.ListRequest中消失。我無法找到使用的替代方法。任何線索?確認我在VS2013的NuGet中使用最新的Google.Apis和Google.Apis.Drive。 –

0

當前方法似乎是ExecuteAsync

var request = _driveService.Files.List(); 
request.Q = "mimeType='application/vnd.google-apps.folder' and trashed=false"; 

var result = await request.ExecuteAsync() 

我不知道這是僅適用於Windows應用商店和Windows Phone 8.1的應用程序,或者如果Execute方法已經到處刪除。

相關問題