Google drive api 我上传到google drive';s服务帐户的文件
我有下面的代码将文件上传到我的谷歌服务帐户。它正在工作,但我想知道文件在哪里?我可以使用哪个帐户登录google drive并获取文件?我可以使用多少空间?服务帐户是否有类似google drive的用户界面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) {
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?