Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google drive api 我上传到google drive';s服务帐户的文件_Google Drive Api_Service Accounts - Fatal编程技术网

Google drive api 我上传到google drive';s服务帐户的文件

Google drive api 我上传到google drive';s服务帐户的文件,google-drive-api,service-accounts,Google Drive Api,Service Accounts,我有下面的代码将文件上传到我的谷歌服务帐户。它正在工作,但我想知道文件在哪里?我可以使用哪个帐户登录google drive并获取文件?我可以使用多少空间?服务帐户是否有类似google drive的用户界面 private static Google.Apis.Drive.v2.Data.File insertFile( String title, String mimeType, MemoryStream FileStream) {

我有下面的代码将文件上传到我的谷歌服务帐户。它正在工作,但我想知道文件在哪里?我可以使用哪个帐户登录google drive并获取文件?我可以使用多少空间?服务帐户是否有类似google drive的用户界面

private static Google.Apis.Drive.v2.Data.File insertFile(
      String title, 
      String mimeType, 
      MemoryStream FileStream)
    {
        String serviceAccountEmail = "XXXXXX@developer.gserviceaccount.com";

        var certificate = new X509Certificate2(
             @"XXXXXXprivatekey.p12", 
             "notasecret", 
             X509KeyStorageFlags.Exportable);

        ServiceAccountCredential credential = new ServiceAccountCredential(
           new ServiceAccountCredential.Initializer(serviceAccountEmail)
           {
               Scopes = new[] { DriveService.Scope.Drive }
           }.FromCertificate(certificate));

        // Create the service.
        DriveService service = new DriveService(
                                   new BaseClientService.Initializer()
        {
            HttpClientInitializer = credential,
            ApplicationName = "Drive API Sample",
        });

        // File's metadata.
        Google.Apis.Drive.v2.Data.File body = 
                  new Google.Apis.Drive.v2.Data.File();
        body.Title = title;
        body.Description = title;
        body.MimeType = mimeType;

        FilesResource.InsertMediaUpload request = 
              service.Files.Insert(body, FileStream, mimeType);
        request.Upload();

        Google.Apis.Drive.v2.Data.File file = request.ResponseBody;

        return file;
    }

服务帐户没有用户界面。这些文件只能由您的应用程序访问。

没有服务帐户的用户界面。这些文件只能由您的应用程序访问。

没有服务帐户的用户界面。这些文件只能由您的应用程序访问。

没有服务帐户的用户界面。这些文件只有你的应用程序才能访问。

Ho~真的吗?我可以使用多大的尺寸?15GB?呵呵~真的吗?我能用多大尺寸?15GB?呵呵~真的吗?我能用多大尺寸?15GB?呵呵~真的吗?我能用多大尺寸?15GB?