Amazon.S3.AmazonS3Client.DeleteObject C# (CSharp) Method

DeleteObject() public method

Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object. If there isn't a null version, Amazon S3 does not remove any objects.
public DeleteObject ( DeleteObjectRequest request ) : DeleteObjectResponse
request Amazon.S3.Model.DeleteObjectRequest Container for the necessary parameters to execute the DeleteObject service method.
return Amazon.S3.Model.DeleteObjectResponse
        public DeleteObjectResponse DeleteObject(DeleteObjectRequest request)
        {
            var marshaller = new DeleteObjectRequestMarshaller();
            var unmarshaller = DeleteObjectResponseUnmarshaller.Instance;

            return Invoke<DeleteObjectRequest,DeleteObjectResponse>(request, marshaller, unmarshaller);
        }

Same methods

AmazonS3Client::DeleteObject ( string bucketName, string key ) : DeleteObjectResponse
AmazonS3Client::DeleteObject ( string bucketName, string key, string versionId ) : DeleteObjectResponse

Usage Example

コード例 #1
1
 public void DeleteFile(String filename)
 {
     String key = filename;
     var amazonClient = new AmazonS3Client(_keyPublic, _keySecret);
     var deleteObjectRequest = new DeleteObjectRequest { BucketName = _bucket, Key = key };
     var response = amazonClient.DeleteObject(deleteObjectRequest);
 }
All Usage Examples Of Amazon.S3.AmazonS3Client::DeleteObject
AmazonS3Client