Creates the bucket. According to bucket naming rule by Baidu, all bucket names would be changed to lower case inside client for any bucket operation. If the bucket is already existed, you would get http 403 error.

The following code would show you how to create, get and delete bucket in BaiduBCSClient
// You need to assign your bucket in your code
string bucket = "TestBucket";
// You need to assign your app key and your secret key in your code
var client = new BaiduBCSClient("your app key", "your secret key");

// According to bucket naming rule by Baidu, all bucket names would be changed to lower case inside client for any bucket operation.
client.CreateBucket(bucket);

// Get bucket list and output summary via Console.
var bucketList = client.GetBucketList();

foreach (var one in bucketList)
{
    Console.WriteLine(string.Format("{Bucket: {0}, TotalCapacity: {1}.", one.Name, one.TotalCapacity));
}

// Delete bucket.
client.DeleteBucket(bucket);

Last edited Aug 13, 2014 at 7:43 AM by rynnwang, version 1