コード例 #1
0
ファイル: BucketDomain.cs プロジェクト: zsp7280/cos-snippets
        /// 获取存储桶自定义域名
        public void GetBucketDomain()
        {
            //.cssg-snippet-body-start:[get-bucket-domain]
            try
            {
                string bucket = "examplebucket-1250000000"; //格式:BucketName-APPID
                GetBucketDomainRequest request = new GetBucketDomainRequest(bucket);
                //执行请求
                GetBucketDomainResult result = cosXml.getBucketDomain(request);

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