对象标签使用一组键值对(Key-Value)来标记对象。本文介绍如何删除对象标签。

以下代码用于删除对象标签:

using Aliyun.OSS;
var endpoint = "<yourEndpoint>";
var accessKeyId = "<yourAccessKeyId>";
var accessKeySecret = "<yourAccessKeySecret>";
var bucketName = "<yourBucketName>";
var objectName = "<yourObjectName>";
// 创建OssClient实例。
var client = new OssClient(endpoint, accessKeyId, accessKeySecret);
try
{
    // 删除对象标签。
    var result = client.DeleteObjectTagging(bucketName,objectName);
    Console.WriteLine("delete objects tagging succeeded");
}
catch (Exception ex)
{
    Console.WriteLine("delete objects failed. {0}", ex.Message);
}

有关删除对象标签的详情请参见DeleteObjectTagging。有关对象标签的详情请参见对象标签