public buckets ( ) : |
||
Résultat |
/// <summary> /// 列举所有的bucket /// </summary> public static void buckets() { Mac mac = new Mac(Settings.AccessKey, Settings.SecretKey); BucketManager bm = new BucketManager(mac); BucketsResult result = bm.buckets(); foreach(string bucket in result.Buckets) { System.Console.WriteLine(bucket); } }
public void bktMgrTest() { //Settings.load(); Settings.LoadFromFile(); string testResUrl = "http://test.fengyh.cn/qiniu/files/hello.txt"; Mac mac = new Mac(Settings.AccessKey, Settings.SecretKey); BucketManager target = new BucketManager(mac); target.fetch(testResUrl, Settings.Bucket, "test_BucketManager.txt"); target.stat(Settings.Bucket, "test_BucketManager.txt"); target.copy(Settings.Bucket, "test_BucketManager.txt", Settings.Bucket, "copy_BucketManager.txt", true); target.move(Settings.Bucket, "copy_BucketManager.txt", Settings.Bucket, "move_BucketManager.txt", true); target.delete(Settings.Bucket, "test_BucketManager.txt"); DomainsResult domainsResult = target.domains(Settings.Bucket); BucketsResult bucketsResult = target.buckets(); }