示例#1
0
        /// 列出已上传的分片
        public void ListParts()
        {
            //.cssg-snippet-body-start:[list-parts]
            try
            {
                string           bucket   = "examplebucket-1250000000"; //存储桶,格式:BucketName-APPID
                string           key      = "exampleobject";            //对象键
                string           uploadId = "exampleUploadId";          //初始化分块上传返回的uploadId
                ListPartsRequest request  = new ListPartsRequest(bucket, key, uploadId);
                //执行请求
                ListPartsResult result = cosXml.ListParts(request);
                //请求成功
                //列举已上传的分块
                List <COSXML.Model.Tag.ListParts.Part> alreadyUploadParts = result.listParts.parts;
                Console.WriteLine(result.GetResultInfo());
            }
            catch (COSXML.CosException.CosClientException clientEx)
            {
                //请求失败
                Console.WriteLine("CosClientException: " + clientEx);
            }
            catch (COSXML.CosException.CosServerException serverEx)
            {
                //请求失败
                Console.WriteLine("CosServerException: " + serverEx.GetInfo());
            }

            //.cssg-snippet-body-end
        }