How to get buckets count in aws ( Amazon Web Services ) using C# in ASP.Net

on Jun 16, 2017 02:40 AM

Guys how do i know how many buckets are there in amazon web services..?? Using c# i have access id , secret key , i need to get the list of buckets in aws 


please help??

Download FREE API for Word, Excel and PDF in ASP.Net: Download
on Jun 16, 2017 02:56 AM

Not objects in the amazon s3, i need to find how many buckets are present in amazon s3 

on Jun 16, 2017 04:53 AM
on Jun 16, 2017 04:55 AM
on Jun 16, 2017 11:58 PM


using (IAmazonS3 client = new AmazonS3Client(awsAccessKeyID,awsSecretAccessKEy, Amazon.RegionEndpoint.USEast1))
    ListBucketsResponse response = client.ListBuckets();
    List<S3Bucket> buckets = response.Buckets;
    foreach (S3Bucket bucket in buckets)
         Console.WriteLine("Found bucket name {0} created at {1}", bucket.BucketName, bucket.CreationDate);

This returns the buckets list in aws..

We can check how many buckets are present in aws...

Hope it helps.