public copy ( string srcBucket, string srcKey, string destBucket, string destKey ) : Qiniu.Http.HttpResult | ||
srcBucket | string | |
srcKey | string | |
destBucket | string | |
destKey | string | |
Результат | Qiniu.Http.HttpResult |
/// <summary> /// 复制文件 /// </summary> public static void copy() { Mac mac = new Mac(Settings.AccessKey, Settings.SecretKey); string srcBucket = "SRC_BUCKET"; string srcKey = "SRC_KEY"; string dstBucket = "SRC_BUCKET"; string dstKey = "DST_BUCKET"; BucketManager bm = new BucketManager(mac); HttpResult result = bm.copy(srcBucket, srcKey, dstBucket, dstKey); //支持force参数, bool force = true/false //HttpResult result = bm.copy(srcBucket, srcKey, dstBucket, dstKey, force); }
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(); }