There is almost no samples or documentation available anywhere for this, so I thought I would write this up myself as using the storage from GCS (similar to Amazon S3 and Azure Blob Storage) is one of the most basic things which people do with the cloud. The very first thing to do after creating the C# project in Visual Studio is to install the Nuget package mentioned here: https://www.nuget.org/packages/Google.Apis.Storage.v1/ There is a lot of confusion with multiple packages available, but this is what you want for GCS. Install-Package Google.Apis.Storage.v1 You are going to need to reference the following namespaces: using Google.Apis.Auth.OAuth2; using Google.Apis.Storage.v1; Setup the basic items you need for making the calls: private static ClientSecrets _clientSecrets = new ClientSecrets(); private static UserCredential _userCredential = null; private static StorageService _storageService = new StorageService(); private const string
Comments
Post a Comment