C# AWS: Using AWS SDK Library (.NET) for Titan Cloud Storage
Amazon S3 is a cloud-based storage service provided by Amazon Web Services (AWS) that allows individuals and businesses to store and retrieve data over the internet. AWS SDK is an open-source, high-performance object storage system that is compatible with Amazon S3 API. This means that developers can use the AWS SDK .NET SDK to build applications that are compatible with Amazon S3 and can store and retrieve data using the Titan Cloud Storage service. Essentially, AWS SDK .NET provides a convenient way for developers to interact with the Titan Cloud Storage service using the same API that Amazon S3 provides, making it easier to build applications that use cloud-based storage.
This quick start guide will show you how to install the Visual studio and run a few basic c# program examples.
Prerequisites
Prerequisites required are as follows:
- AWS SDK .NET SDK package
Goals
After finishing this article, you'll be able to:
- Initialize Titan cloud instance.
- Create a new bucket with a specified name.
- Checking if the bucket exists.
- Delete an existing bucket.
- Retrieve a list of all buckets in the account.
- Upload a new object to a bucket or replace an existing object with a new version.
- Retrieve an object from a bucket and download it to a local machine.
- Delete an object from a bucket.
- Delete many objects from a bucket.
- Retrieve a list of objects within a bucket.
- Make a copy of an existing object within the same bucket or in a different bucket.
- Check if an object exists in a bucket or not.
- Uploads a file to a bucket.
- Downloads an object from a bucket to a file.
How do I use AWS SDK for .NET with Titan Cloud Storage?
Here are the steps to install and run AWS SDK for .NET with Visual Studio IDE with Titan Cloud Storage:
Step 1. Download and Install Visual Studio IDE.
• If you haven't already done so, download and install Visual Studio from the official website based on your operating system.
For more details please visit: Download Visual Studio Tools - Install Free for Windows, Mac, Linux (microsoft.com)
Step 2. Create a new .NET Core project
Open Visual Studio and create a new .NET Core console application project by following steps.
Step 3. Install the AWS SDK .NET SDK
• Right-click on the project in the Solution Explorer and select “Manage NuGet Packages”. Search for “AWS SDK” and install the AWS SDK .NET SDK package.
Go and check in Installed tab if the package is installed.
Step 4. Use the AWS.NET SDK in your code and run .NET code
Titan Cloud Storage is an S3-compatible cloud storage service that supports the S3 API. Therefore, you can use the AWS SDK for .NET with Titan Cloud Storage by configuring the SDK to use the Titan Cloud Storage endpoint and your Titan Cloud Storage credentials.
Here's an example of how to configure the AWS SDK for .NET to use Titan Cloud Storage:
Complete Program:
using System;
using System.Threading.Tasks;
using Amazon;
using Amazon.S3;
using Amazon.S3.Model;
public class Program
{
public const string accessKey = “”;
public const string secretKey = “”;
static async Task Main(string[] args)
{
try
{
var config = new AmazonS3Config
{
RegionEndpoint = RegionEndpoint.USEast1,
ServiceURL = “https://{YOUR_INSTANCE}.s3.titancloudstorage.com”,
ForcePathStyle = true,
UseHttp = true
};
AmazonS3Client titanclient = new AmazonS3Client(accessKey, secretKey, config);
ListBucketsResponse response = await titanclient.ListBucketsAsync();
Console.WriteLine(“Buckets on Titan Cloud Storage:”);
foreach (S3Bucket bucket in response.Buckets)
{
Console.WriteLine(bucket.BucketName);
}
}
catch (AmazonS3Exception ex)
{
Console.WriteLine(“Error encountered ***”);
Console.WriteLine(“Exception message: {0}”, ex.Message);
}
Console.ReadKey();
}
}
Step 5. Build and run your project:
Build the application by pressing “Ctrl+Shift+B” or by right-clicking on the project in the Solution Explorer and selecting “Build”. Run the application by pressing “F5” or by right-clicking on the project in the Solution Explorer and selecting “Debug > Start New Instance”.
That's it! You now know how to install and run the AWS SDK Client SDK for .NET with Visual Studio.
Quick Start Examples
With the AWS SDK .NET SDK, developers can quickly and easily build powerful applications that use Titan Cloud Storage's features and take advantage of the .NET programming language's ease of use and flexibility. Developers can use the SDK to do many different things with Titan Cloud Storage, like creating and deleting buckets, uploading and downloading objects, and managing bucket policies and metadata.
Bucket operations
Bucket operations are operations that can be performed on buckets in cloud object storage services such as AWS SDK, Amazon S3, and Google Cloud Storage. Some common bucket operations include:
• Create bucket: Create a new bucket with a specified name.
• Delete bucket: Delete an existing bucket
• List buckets: Retrieve a list of all buckets in the account.
These operations can be performed using the API provided by the cloud object storage service or using client libraries like AWS SDK Go. We will see few operations below with code examples and explanation.
1. Initializes a new Titan Cloud Connection Code:
The below code snippets Initializes a new Titan Cloud object storage client.General Method:
public AWS SDKClient(string endpoint, string accessKey = ““, string secretKey = ““, string region = ““, string sessionToken=““)
Note: Before running this code, make sure to replace the endpoint
, accessKey
, and secretKey
variables with the appropriate values for your Titan Cloud Storage account.
Code File:
using AWS SDK;
using AWS SDK.Exceptions;
using System.Net;
using System.Threading.Tasks;
public class Program
{
public static async Task Main(string[] args)
{
var endpoint = “{YOUR_INSTANCE}.s3.titancloudstorage.com”;
var accessKey = “<access_key>”;
var secretKey = “<secret_key>”;
var secure = true;
Console.WriteLine(“create client instance!”);
AWS SDKClient AWS SDK = new AWS SDKClient()
.WithEndpoint(endpoint)
.WithCredentials(accessKey, secretKey)
.WithSSL(secure)
.Build();
Console.ReadLine();
}
}
}
Build Solution:
Right Click on Solution and Click Build Solution or Press Crtl+Shift+B
2. Check if a bucket exists on Titan Cloud
To check if a bucket exists on Titan Cloud Storage, you can use the AmazonS3Client class provided by the AWS SDK for .NET and call the ListBucketsAsync method to get a list of all buckets associated with the current account. Then you can check if the bucket name you're looking for exists in the list of buckets.
General Method:
using (var s3Client = new AmazonS3Client(accessKey, secretKey, config))
{
var response = await s3Client.ListBucketsAsync();
var bucketExists = response.Buckets.Any(b => b.BucketName == bucketName);
return bucketExists;
}
Code File:
using System;
using System.Net;
using System.Threading.Tasks;
using Amazon;
using Amazon.S3;
using Amazon.S3.Model;
public class Program
{
public const string accessKey = “”;
public const string secretKey = “”;
public const string bucketName = “titanbucket”;
static async Task Main(string[] args)
{
try
{
var config = new AmazonS3Config
{
RegionEndpoint = RegionEndpoint.USEast1,
ServiceURL = “https://{YOUR_INSTANCE}.s3.titancloudstorage.com”,
ForcePathStyle = true,
UseHttp = true
};
AmazonS3Client titanclient = new AmazonS3Client(accessKey, secretKey, config);
bool bucketExists = false;
ListBucketsResponse response = await titanclient.ListBucketsAsync();
foreach (S3Bucket bucket in response.Buckets)
{
if (bucket.BucketName.Equals(bucketName, StringComparison.OrdinalIgnoreCase))
{
bucketExists = true;
break;
}
}
if (bucketExists)
{
Console.WriteLine($“Bucket '{bucketName}' already exists.”);
return;
}
else
{
Console.WriteLine($“Bucket '{bucketName}' doesnt exists.”);
}
Console.ReadKey();
}
catch (AmazonS3Exception ex)
{
Console.WriteLine(“Error encountered ***”);
Console.WriteLine(“Exception message: {0}”, ex.Message);
Console.ReadKey();
}
}
}
Build Solution:
Right Click on Solution and Click Build Solution or Press Crtl+Shift+B
3. Create a bucket on Titan Cloud
The below code snippets create a bucket on the Titan Cloud server.General Method:
Task MakeBucketAsync(string bucketName, string location = "us-east-1", CancellationToken cancellationToken = default(CancellationToken))
using System;
using System.Net;
using System.Threading.Tasks;
using Amazon;
using Amazon.S3;
using Amazon.S3.Model;
public class Program
{
public const string accessKey = ““;
public const string secretKey = ““;
public const string bucketName = “titanbucketnew”;
static async Task Main(string[] args)
{
try
{
var config = new AmazonS3Config
{
RegionEndpoint = RegionEndpoint.USEast1,
ServiceURL = “https://{YOUR_INSTANCE}.s3.titancloudstorage.com”,
ForcePathStyle = true,
UseHttp = true
};
AmazonS3Client titanclient = new AmazonS3Client(accessKey, secretKey, config);
var request = new PutBucketRequest
{
BucketName = bucketName,
UseClientRegion = true
};
PutBucketResponse putResponse = await titanclient.PutBucketAsync(request).ConfigureAwait(false);
if (putResponse.HttpStatusCode == HttpStatusCode.OK)
{
Console.WriteLine($“Bucket '{bucketName}' created successfully!”);
}
else
{
Console.WriteLine($“Failed to create bucket '{bucketName}'!”);
}
Console.ReadKey();
}
catch (AmazonS3Exception ex)
{
Console.WriteLine(“Error encountered ***”);
Console.WriteLine(“Exception message: {0}”, ex.Message);
Console.ReadKey();
}
}
}
Build Solution:
Right Click on Solution and Click Build Solution or Press Crtl+Shift+B
4. Remove an empty bucket with Titan Cloud Storage
The below code snippets delete the specified S3 bucket. Before the bucket can be deleted, all of the objects in it, including all versions and delete markers, must be deleted on a Titan Cloud.General Method:
Task RemoveBucketAsync(string bucketName, CancellationToken cancellationToken = default(CancellationToken))
Removes a bucket.
NOTE: - removeBucket does not delete the objects inside the bucket. The objects need to be deleted using the removeObject API.
using AWS SDK;
using AWS SDK.Exceptions;
using System.Net;
using System.Threading.Tasks;
public class Program
{
public static async Task Main(string[] args)
{
var endpoint = “{YOUR_INSTANCE}.s3.titancloudstorage.com”;
var accessKey = ““;
var secretKey = ““;
var secure = true;
Console.WriteLine(“create client instance!”);
AWS SDKClient AWS SDK = new AWS SDKClient()
.WithEndpoint(endpoint)
.WithCredentials(accessKey, secretKey)
.WithSSL(secure)
.Build();
// Create a new bucket
var bucketName = “titan-bucket”;
var location = “us-east-1”;
var bucketExists = await AWS SDK.BucketExistsAsync(bucketName);
try
{
if (!bucketExists)
{
Console.WriteLine($”Bucket '{bucketName}' doesnt exists.”);
}
else
{
Console.WriteLine($“Bucket '{bucketName}' exists.”);
// Remove bucket my-bucketname. This operation will succeed only if the bucket is empty.
await AWS SDK.RemoveBucketAsync(bucketName);
Console.WriteLine($“Bucket '{bucketName}' removed successfully.”);
}
Console.ReadLine();
}
catch (AWS SDKException e)
{
Console.WriteLine(“Error occurred: “ + e);
}
}
}
Build Solution:
Right Click on Solution and Click Build Solution or Press Crtl+Shift+B
5. List buckets on Titan Cloud Storage
The below code snippets show all the accessible buckets information on a Titan Cloud.General Method:
Task ListBucketsAsync(CancellationToken cancellationToken = default(CancellationToken))
using System;
using System.Threading.Tasks;
using Amazon;
using Amazon.S3;
using Amazon.S3.Model;
public class Program
{
public const string accessKey = “<access_key>”;
public const string secretKey = “<secret_key>”;
static async Task Main(string[] args)
{
try
{
var config = new AmazonS3Config
{
RegionEndpoint = RegionEndpoint.USEast1,
ServiceURL = “https://{YOUR_INSTANCE}.s3.titancloudstorage.com”,
ForcePathStyle = true,
UseHttp = true
};
AmazonS3Client titanclient = new AmazonS3Client(accessKey, secretKey, config);
ListBucketsResponse response = await titanclient.ListBucketsAsync();
Console.WriteLine(“Buckets on Titan Cloud Storage:”);
foreach (S3Bucket bucket in response.Buckets)
{
Console.WriteLine(bucket.BucketName);
}
}
catch (AmazonS3Exception ex)
{
Console.WriteLine(“Error encountered ***”);
Console.WriteLine(“Exception message: {0}”, ex.Message);
}
Console.ReadKey();
}
}
Build Solution:
Right Click on Solution and Click Build Solution or Press Crtl+Shift+B
Object operations
Object operations refer to the various actions that can be performed on individual objects stored within a bucket in object storage systems. Some common object operations include:
• Put Object: This operation is used to upload a new object to a bucket or replace an existing object with a new version.
• Get Object: This operation is used to retrieve an object from a bucket and download it to a local machine.
• Delete Object: This operation is used to delete an object from a bucket.
• Delete Multiple Objects: This operation is used to delete many objects from a bucket.
• List Objects: This operation is used to retrieve a list of objects within a bucket.
• Copy Object: This operation is used to make a copy of an existing object within the same bucket or in a different bucket.
• Check Object Existence: This operation is used to check if an object exists in a bucket or not.
1. Copy object to a bucket on Titan Cloud Storage
The code snippets below show how to copy object using AWS SDK for .NET from a bucket on a Titan Cloud Storage service. Create or replace an object through server-side copying of an existing object. It supports conditional copying, copying a part of an object and server-side encryption of destination and decryption of source.
General Method:
Task CopyObjectAsync(CopyObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))
using AWS SDK;
using AWS SDK.Exceptions;
using System;
using System.IO;
using System.Threading.Tasks;
public class Program
{
[Obsolete]
public static async Task Main(string[] args)
{
var endpoint = “{YOUR_INSTANCE}.s3.titancloudstorage.com”;
var accessKey = “”;
var secretKey = “”;
var secure = true;
Console.WriteLine(“create client instance!”);
AWS SDKClient AWS SDK = new AWS SDKClient()
.WithEndpoint(endpoint)
.WithCredentials(accessKey, secretKey)
.WithSSL(secure)
.Build();
var sourceBucket = “my-bucket”;
var sourceObject = “cat.jpg”;
// name of the destination bucket and object with new name
var destBucket = “aws-bucket”;
var destObject = “kitti.jpg”;
try
{
// Check if the bucket exists.
bool found = await AWS SDK.BucketExistsAsync(sourceBucket);
if (!found)
{
Console.WriteLine($“Bucket '{sourceBucket}' not found.”);
return;
}
// copy object to destination with new name
await AWS SDK.CopyObjectAsync(sourceBucket, sourceObject, destBucket, destObject).ConfigureAwait(false);
Console.WriteLine($“Object '{sourceObject}' copied to bucket '{destBucket}' with new name '{destObject}'“);
}
catch (AWS SDKException e)
{
Console.WriteLine(“Error occurred: “ + e);
}
}
}
Build Solution:
Right Click on Solution and Click Build Solution or Press Crtl+Shift+B
2. Check Object Existence in a bucket on Titan Cloud Storage
The code snippets below show how to check object existence using AWS SDK for .NET from a bucket on a Titan Cloud Storage service.
General Method:
Task StatObjectAsync(StatObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))
Code File:
using AWS SDK;
using AWS SDK.Exceptions;
using System;
using System.Threading.Tasks;
public class Program
{
[Obsolete]
public static async Task Main(string[] args)
{
var endpoint = “{YOUR_INSTANCE}.s3.titancloudstorage.com”;
var accessKey = “”;
var secretKey = “”;
var secure = true;
Console.WriteLine(“create client instance!”);
AWS SDKClient AWS SDK = new AWS SDKClient()
.WithEndpoint(endpoint)
.WithCredentials(accessKey, secretKey)
.WithSSL(secure)
.Build();
string bucketName = “my-bucket”;
string objectName = “cat.jpg”;
bool objectExists = false;
try
{
// Check if object exists in the bucket
var stat = await AWS SDK.StatObjectAsync(bucketName, objectName);
objectExists = true;
Console.WriteLine($“Object '{objectName}' exists in the bucket '{bucketName}'.”);
}
catch (AWS SDKException e)
{
Console.WriteLine($”Error occurred: {e.Message}”);
}
if (!objectExists)
{
Console.WriteLine($”Object '{objectName}' does not exist in the bucket '{bucketName}'.”);
}
Console.ReadLine();
}
}
Build Solution:
Right Click on Solution and Click Build Solution or Press Crtl+Shift+B
3. Put Object from a bucket on Titan Cloud
The code snippets below show how to put files from a bucket on a Titan Cloud. The PutObject method is a function provided by the AWS SDK .NET client library that is used to upload an object to a bucket in a Titan Cloud storage service.
General Method:
Task PutObjectAsync(PutObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))
Note: Uploads objects that are less than 128MiB in a single PUT operation. For objects that are greater than 128MiB in size, PutObject seamlessly uploads the object as parts of 128MiB or more depending on the actual file size. The max upload size for an object is 5TB.
Code File:
using System;
using System.IO;
using System.Threading.Tasks;
using Amazon;
using Amazon.S3;
using Amazon.S3.Model;
public class Program
{
public const string accessKey = ““;
public const string secretKey = ““;
public const string bucketName = “my-bucket”;
public const string objectKey = “my-object.txt”;
public const string filePath = @”C:\Users\titanadmin\Downloads\text.txt”;
static async Task Main(string[] args)
{
try
{
var config = new AmazonS3Config
{
RegionEndpoint = RegionEndpoint.USEast1,
ServiceURL = “https://{YOUR_INSTANCE}.s3.titancloudstorage.com”,
ForcePathStyle = true,
UseHttp = true
};
AmazonS3Client titanclient = new AmazonS3Client(accessKey, secretKey, config);
using (var fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
{
var request = new PutObjectRequest
{
BucketName = bucketName,
Key = objectKey,
InputStream = fileStream
};
PutObjectResponse response = await titanclient.PutObjectAsync(request).ConfigureAwait(false);
}
Console.WriteLine($“Object '{objectKey}' uploaded to bucket '{bucketName}'”);
}
catch (AmazonS3Exception ex)
{
Console.WriteLine(“Error encountered ***”);
Console.WriteLine(“Exception message: {0}”, ex.Message);
}
Console.ReadKey();
}
}
Build Solution:
Right Click on Solution and Click Build Solution or Press Crtl+Shift+B
4. Get Object from a bucket on Titan Cloud
The code snippets below show how to get object from a bucket on a Titan Cloud. In the AWS SDK .NET library, the GetObject method is used to retrieve an object from a bucket in the titan cloud storage service.
General Method:
Task GetObjectAsync(GetObjectArgs args, ServerSideEncryption sse = null, CancellationToken cancellationToken = default(CancellationToken))
using System;
using System.IO;
using System.Threading.Tasks;
using Amazon;
using Amazon.S3;
using Amazon.S3.Model;
public class Program
{
public const string accessKey = ““;
public const string secretKey = ““;
public const string bucketName = “my-bucket”;
public const string objectKey = “my-object.txt”;
public const string filePath = @”C:\Users\titanadmin\Desktop\DotnetProject\file.txt”;
static async Task Main(string[] args)
{
try
{
var config = new AmazonS3Config
{
RegionEndpoint = RegionEndpoint.USEast1,
ServiceURL = “https://{YOUR_INSTANCE}.s3.titancloudstorage.com”,
ForcePathStyle = true,
UseHttp = true
};
AmazonS3Client titanclient = new AmazonS3Client(accessKey, secretKey, config);
using (GetObjectResponse response = await titanclient.GetObjectAsync(bucketName, objectKey))
{
await response.WriteResponseStreamToFileAsync(filePath, false, default).ConfigureAwait(false);
}
Console.WriteLine($“Object '{objectKey}' downloaded from bucket '{bucketName}' to '{filePath}'”);
}
catch (AmazonS3Exception ex)
{
Console.WriteLine(“Error encountered ***”);
Console.WriteLine(“Exception message: {0}”, ex.Message);
}
Console.ReadKey();
}
}
Build Solution:
Right Click on Solution and Click Build Solution or Press Crtl+Shift+B
5. List all the objects in the bucket on Titan Cloud
The code snippets below show how to list the items' details, optionally including bucket versions created on a Titan Cloud.General Method:
ListObjects(ctx context.Context, bucketName string, opts ListObjectsOptions) <-chan ObjectInfo
Code File:
using System;
using System.Threading.Tasks;
using Amazon;
using Amazon.S3;
using Amazon.S3.Model;
public class Program
{
public const string accessKey = ““;
public const string secretKey = ““;
public const string bucketName = “my-bucket”;
static async Task Main(string[] args) { try { var config = new AmazonS3Config { RegionEndpoint = RegionEndpoint.USEast1, ServiceURL = “https://{YOUR_INSTANCE}.s3.titancloudstorage.com”, ForcePathStyle = true, UseHttp = true }; AmazonS3Client titanclient = new AmazonS3Client(accessKey, secretKey, config); var request = new ListObjectsRequest { BucketName = bucketName }; ListObjectsResponse response = await titanclient.ListObjectsAsync(request).ConfigureAwait(false); Console.WriteLine($“Objects in bucket '{bucketName}':”); foreach (S3Object s3Object in response.S3Objects) { Console.WriteLine($”- {s3Object.Key}”); } } catch (AmazonS3Exception ex) { Console.WriteLine(“Error encountered ***”); Console.WriteLine(“Exception message: {0}”, ex.Message); } Console.ReadKey(); }
}
Build Solution:
Right Click on Solution and Click Build Solution or Press Crtl+Shift+B
6. Remove an object from bucket on Titan Cloud
The below code snippets remove an object from the bucket information on a Titan Cloud.General Method:
Task RemoveObjectAsync(RemoveObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))
Code File:
using System;
using System.Threading.Tasks;
using Amazon;
using Amazon.S3;
using Amazon.S3.Model;
public class Program
{
public const string accessKey = ““;
public const string secretKey = ““;
public const string bucketName = “my-bucket”;
public const string objectKey = “my-object.txt”;
static async Task Main(string[] args)
{
try
{
var config = new AmazonS3Config
{
RegionEndpoint = RegionEndpoint.USEast1,
ServiceURL = “https://{YOUR_INSTANCE}.s3.titancloudstorage.com”,
ForcePathStyle = true,
UseHttp = true
};
AmazonS3Client titanclient = new AmazonS3Client(accessKey, secretKey, config);
var request = new DeleteObjectRequest
{
BucketName = bucketName,
Key = objectKey
};
DeleteObjectResponse response = await titanclient.DeleteObjectAsync(request).ConfigureAwait(false);
Console.WriteLine($“Object '{objectKey}' deleted from bucket '{bucketName}'”);
}
catch (AmazonS3Exception ex)
{
Console.WriteLine(“Error encountered ***”);
Console.WriteLine(“Exception message: {0}”, ex.Message);
}
Console.ReadKey();
}
}
Build Solution:
Right Click on Solution and Click Build Solution or Press Crtl+Shift+B
7. Remove multiple objects from bucket on Titan Cloud
7. Remove multiple objects from bucket on Titan Cloud
The code snippets below show how to delete numerous objects from the bucket simultaneously on a Titan Cloud.General Method:
Task> RemoveObjectsAsync(RemoveObjectsArgs args, CancellationToken cancellationToken = default(CancellationToken))
Code File:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Amazon;
using Amazon.S3;
using Amazon.S3.Model;
public class Program
{
public const string accessKey = ““;
public const string secretKey = ““;
public const string bucketName = “my-bucket”;
public static List objectKeys = new List { “object1.txt”, “object2.txt”, “object3.txt” };
static async Task Main(string[] args) { try { var config = new AmazonS3Config { RegionEndpoint = RegionEndpoint.USEast1, ServiceURL = “https://{YOUR_INSTANCE}.s3.titancloudstorage.com”, ForcePathStyle = true, UseHttp = true }; AmazonS3Client titanclient = new AmazonS3Client(accessKey, secretKey, config); var request = new DeleteObjectsRequest { BucketName = bucketName, Objects = new List<KeyVersion>() }; foreach (string objectKey in objectKeys) { request.Objects.Add(new KeyVersion { Key = objectKey }); } DeleteObjectsResponse response = await titanclient.DeleteObjectsAsync(request).ConfigureAwait(false); Console.WriteLine($“Deleted {response.DeletedObjects.Count} objects from bucket '{bucketName}':”); foreach (DeletedObject deletedObject in response.DeletedObjects) { Console.WriteLine($”- {deletedObject.Key}”); } } catch (AmazonS3Exception ex) { Console.WriteLine(“Error encountered ***”); Console.WriteLine(“Exception message: {0}”, ex.Message); } Console.ReadKey(); }
}
Build Solution:
Right Click on Solution and Click Build Solution or Press Crtl+Shift+B