(0) exportieren Drucken
Alle erweitern

BlobRequestOptions.AccessCondition-Eigenschaft

Gets or sets the access condition for the request.

Namespace: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in microsoft.windowsazure.storageclient.dll)

'Usage
Dim instance As BlobRequestOptions
Dim value As AccessCondition

value = instance.AccessCondition

instance.AccessCondition = value

public AccessCondition AccessCondition { get; set; }
/** @property */
/** @attribute CompilerGeneratedAttribute() */ 
public AccessCondition get_AccessCondition ()

/** @property */
/** @attribute CompilerGeneratedAttribute() */ 
public void set_AccessCondition (AccessCondition value)

CompilerGeneratedAttribute 
public function get AccessCondition () : AccessCondition

CompilerGeneratedAttribute 
public function set AccessCondition (value : AccessCondition)

Eigenschaftswert

Type: AccessCondition

A structure that specifies any conditional parameters on the request.

The following example deletes a blob if its ETag matches a specified value.

static void DeleteIfMatch(Uri blobEndpoint, string accountName, string accountKey, string eTag)
{
    CloudBlobClient blobClient = new CloudBlobClient(blobEndpoint, new StorageCredentialsAccountAndKey(accountName, accountKey));

    //Get a reference to the blob.
    CloudBlob blob = blobClient.GetBlobReference("mycontainer/myblob.txt");

    //Indicate that any snapshots should be deleted.
    BlobRequestOptions options = new BlobRequestOptions();
    options.DeleteSnapshotsOption = DeleteSnapshotsOption.IncludeSnapshots;

    //Specify the if-match condition. The blob will be deleted if its ETag matches the value passed in.
    options.AccessCondition = AccessCondition.IfMatch(eTag);

    //Delete the blob if the condition is met.
    blob.Delete(options);
}


The default access condition for any request is None.

An access condition may specify a condition that must be met for the operation to be performed by the service. The AccessCondition structure provides methods that can be used to specify exactly one of the following access conditions:

  • If-Match, which performs an operation only if the specified Etag value matches the blob's Etag value. Use the IfMatch method to return this access condition.

  • If-None-Match, which performs an operation only if the specified Etag value does not match the blob's Etag value. Use the IfNoneMatch method to return this access condition.

  • If-Modified-Since, which performs an operation only if the resource has been modified since the specified date and time. Use the IfModifiedSince method to return this access condition.

  • If-Not-Modified-Since, which performs an operation only if the resource has not been modified since the specified date and time. Use the IfNotModifiedSince method to return this access condition.


Alle öffentlichen statischen (freigegebenen in Visual Basic) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Entwicklungsplattformen

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2008 und Windows 2000

Zielplattformen

Community-Beiträge

Anzeigen:
© 2014 Microsoft