Exemplo n.º 1
0
        /// 获取存储桶清单任务
        public void GetBucketInventory()
        {
            //.cssg-snippet-body-start:[get-bucket-inventory]
            try
            {
                string inventoryId = "aInventoryId";
                string bucket      = "examplebucket-1250000000"; //格式:BucketName-APPID
                GetBucketInventoryRequest getRequest = new GetBucketInventoryRequest(bucket);
                getRequest.SetInventoryId(inventoryId);

                GetBucketInventoryResult getResult = cosXml.GetBucketInventory(getRequest);

                InventoryConfiguration configuration = getResult.inventoryConfiguration;
            }
            catch (COSXML.CosException.CosClientException clientEx)
            {
                //请求失败
                Console.WriteLine("CosClientException: " + clientEx);
            }
            catch (COSXML.CosException.CosServerException serverEx)
            {
                //请求失败
                Console.WriteLine("CosServerException: " + serverEx.GetInfo());
            }
            //.cssg-snippet-body-end
        }