当前位置: 首页>>代码示例>>C#>>正文


C# IAmazonS3.DeleteObject方法代码示例

本文整理汇总了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);
        }
开发者ID:devaccelerate,项目名称:adapters-aws,代码行数:13,代码来源:AWSFileStorageManager.cs

示例2: DeleteFile

        private void DeleteFile(string path, IAmazonS3 client)
        {
            var request = new DeleteObjectRequest()
            {
                BucketName = BucketName,
                Key = path
            };

            DeleteObjectResponse response = client.DeleteObject(request);
        }
开发者ID:SmartFire,项目名称:JG.Orchard.AmazonS3Storage,代码行数:10,代码来源:S3StorageProvider.cs

示例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);
        }
开发者ID:SmartFire,项目名称:JG.Orchard.AmazonS3Storage,代码行数:23,代码来源:S3StorageProvider.cs

示例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;
 }
开发者ID:LeehanLee,项目名称:L.W,代码行数:6,代码来源:Program.cs


注:本文中的IAmazonS3.DeleteObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。