简体   繁体   English

在C#应用程序中创建默认Google Cloud Storage存储桶区域时进行更改

[英]Change default Google Cloud Storage bucket region when creating it in C# application

I am interested in changing Google Cloud Storage bucket region when creating bucket in C# application programmatically. 我对以编程方式在C#应用程序中创建存储桶时更改Google Cloud Storage存储桶区域感兴趣。 Here is the method: 方法如下:

StorageClient storageClient = StorageClient.Create();        
storageClient.CreateBucket(projectId, bucketName);

But it seems there is no way to change default region. 但是似乎没有办法更改默认区域。 It should be a very simple thing to do, but I can not find any information on it. 这应该是一件非常简单的事情,但是我找不到任何信息。

From the official Google Cloud Storage sample : 来自官方的Google Cloud Storage示例

    private void CreateRegionalBucket(string location, string bucketName)
    {
        var storage = StorageClient.Create();
        Bucket bucket = new Bucket { Location = location, Name = bucketName };
        storage.CreateBucket(s_projectId, bucket);
        Console.WriteLine($"Created {bucketName}.");
    }

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

相关问题 如何从 C# 访问谷歌云存储桶 - How to access Google cloud storage bucket from c# 在 C# 中列出 Google Cloud Storage Bucket 中的嵌套文件夹 - List nested folders in Google Cloud Storage Bucket in C# 使用来自C#的Json文件中的服务帐户的Google云存储桶 - Google cloud storage bucket using service account in Json file from C# 使用RestSharp或C#从Google云存储桶中获取文件 - Get File from Google cloud storage bucket using RestSharp or C# 将文件从本地 C# winforms 应用程序安全上传到生产中的 Google Cloud Storage Bucket - securely uploading files from local C# winforms app to Google Cloud Storage Bucket in production 使用 C# 拉出 Cloud Storage 存储桶 - Pulling out of a Cloud Storage bucket using C# 无法使用C#Windows应用程序将图像上传到Google云存储桶 - Can not upload image to google cloud bucket using c# windows application 以编程方式创建Google Firebase存储桶Unity / C#? - Create Google Firebase Storage Bucket Programmatically Unity / C#? Google云端存储:删除存储桶中的内容 - Google Cloud Storage: Deleting contents of a bucket 使用c#插入Google Cloud Storage时将对象设置为Shared Public URL - Setting an object to Shared Public URL when inserting into Google Cloud Storage using c#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM