示例#1
0
        /// 获取存储桶标签
        public void GetBucketTagging()
        {
            //.cssg-snippet-body-start:[get-bucket-tagging]
            try
            {
                string bucket = "examplebucket-1250000000"; //格式:BucketName-APPID
                GetBucketTaggingRequest request = new GetBucketTaggingRequest(bucket);
                //执行请求
                GetBucketTaggingResult result = cosXml.GetBucketTagging(request);

                //请求成功
                Tagging tagging = result.tagging;
                Console.WriteLine(tagging);
            }
            catch (COSXML.CosException.CosClientException clientEx)
            {
                //请求失败
                Console.WriteLine("CosClientException: " + clientEx);
            }
            catch (COSXML.CosException.CosServerException serverEx)
            {
                //请求失败
                Console.WriteLine("CosServerException: " + serverEx.GetInfo());
            }
            //.cssg-snippet-body-end
        }