简体   繁体   English

使用RestSharp或C#从Google云存储桶中获取文件

[英]Get File from Google cloud storage bucket using RestSharp or C#

i am trying to download file from . 我正在尝试从下载文件。 For downloading i am using rest Sharp API but not succeeded, before it have tried following line of code but still not succeed 对于下载,我尝试使用其余的Sharp API,但未成功,但尝试以下代码行但仍未成功

 Dim dwn As ObjectsResource.GetRequest = New ObjectsResource.GetRequest(storageService, "dfa_-xxxxxx", "kkkk_07-xx-20xx.log.gz")
 Dim stm As FileStream = New FileStream(Server.MapPath("DFA/kkkk_07-xx-20xx.log.gz"), FileMode.Create, FileAccess.Write)
 dwn.Download(stmRead)//Not working

Please suggest what should i do . 请提出我该怎么办。

I got a C# Project "SharpGS".It works fine and Crate & delete buckets,download objects. 我有一个C#项目“ SharpGS”。它可以正常工作,并创建并删除存储桶,下载对象。

http://oleksiy.pro/2010/06/17/google-storage-api-with-c-sharpgs-try-it/ http://oleksiy.pro/2010/06/17/google-storage-api-with-c-sharpgs-try-it/

Here are two keys to be use . 这是两个要使用的键。 Login your Google API console and then click "Here" link in given article's point 2 . 登录您的Google API控制台,然后在给定文章的要点2中单击“此处”链接。 It will redirect to you Google Cloud Storage tab ,see in footer and activate interoperable Storage Access and active it . 它将重定向到您的Google Cloud Storage选项卡,请参见脚注并激活可互操作的Storage Access并将其激活。 Now you can see Access and Secrete Key (term use in project AuthKey /AuthSecret ) 现在您可以看到访问和秘密密钥(在项目AuthKey / AuthSecret中定期使用)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用来自C#的Json文件中的服务帐户的Google云存储桶 - Google cloud storage bucket using service account in Json file from C# 如何从 C# 访问谷歌云存储桶 - How to access Google cloud storage bucket from c# 使用RestSharp从Cloud Sight C#获取图像响应 - Using RestSharp to get image response from Cloud Sight C# 将文件从本地 C# winforms 应用程序安全上传到生产中的 Google Cloud Storage Bucket - securely uploading files from local C# winforms app to Google Cloud Storage Bucket in production 使用 c# 中的 HMAC 密钥将文件上传到 Google Cloud Storage - Upload file to Google Cloud Storage using HMAC key in c# 使用C#从Google云存储下载对象 - download object from Google cloud storage using c# 使用 C# 拉出 Cloud Storage 存储桶 - Pulling out of a Cloud Storage bucket using C# 在C#应用程序中创建默认Google Cloud Storage存储桶区域时进行更改 - Change default Google Cloud Storage bucket region when creating it in C# application 使用Cloud Storage客户端库的Google存储桶统计信息 - Google storage bucket stats using Cloud Storage Client Libraries 使用服务帐户将文件上传到Google Merchant Center中生成的Google Cloud Storage存储桶 - Upload file using Service Account to Google Cloud Storage bucket that was generated in Google Merchant Center
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM