本文整理汇总了C#中IAmazonS3.DeleteObject方法的典型用法代码示例。如果您正苦于以下问题:C# IAmazonS3.DeleteObject方法的具体用法?C# IAmazonS3.DeleteObject怎么用?C# IAmazonS3.DeleteObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAmazonS3
的用法示例。
在下文中一共展示了IAmazonS3.DeleteObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Delete
public override void Delete(string container, string fileName)
{
client = AWSClientFactory.CreateAmazonS3Client(this.ExtendedProperties["accessKey"], this.ExtendedProperties["secretKey"], RegionEndpoint.USEast1);
String S3_KEY = fileName;
DeleteObjectRequest request = new DeleteObjectRequest()
{
BucketName = container,
Key = S3_KEY,
};
DeleteObjectResponse response = client.DeleteObject(request);
}
示例2: DeleteFile
private void DeleteFile(string path, IAmazonS3 client)
{
var request = new DeleteObjectRequest()
{
BucketName = BucketName,
Key = path
};
DeleteObjectResponse response = client.DeleteObject(request);
}
示例3: DeleteFolder
private void DeleteFolder(string path, IAmazonS3 client)
{
EnsureInitialized();
if (_client == null) return;
//TODO: Refractor to use async deletion?
foreach (var folder in ListFolders(path))
{
DeleteFolder(folder.GetPath(), client);
}
foreach (var file in ListFiles(path))
{
DeleteFile(file.GetPath(), client);
}
var request = new DeleteObjectRequest()
{
BucketName = BucketName,
Key = path
};
DeleteObjectResponse response = client.DeleteObject(request);
}
示例4: DeleteFile
public static DeleteObjectResponse DeleteFile(IAmazonS3 s3Client, string s3path, string BucketName = "ulp-learning")
{
DeleteObjectRequest request = new DeleteObjectRequest() { BucketName=BucketName,Key=s3path};
var result=s3Client.DeleteObject(request);
return result;
}