Ejemplo n.º 1
0
        /// 设置存储桶多版本
        public void PutBucketVersioning()
        {
            //.cssg-snippet-body-start:[put-bucket-versioning]
            string bucket = "examplebucket-1250000000"; //格式:BucketName-APPID
            PutBucketVersioningRequest request = new PutBucketVersioningRequest(bucket);

            request.IsEnableVersionConfig(true); //true: 开启版本控制; false:暂停版本控制

            try
            {
                PutBucketVersioningResult result = cosXml.PutBucketVersioning(request);
                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
        }