Экспорт (0) Печать
Развернуть все

Свойство BlobRequestOptions.AccessCondition

Gets or sets the access condition for the request.

Пространство имен: Microsoft.WindowsAzure.StorageClient
Сборка: Microsoft.WindowsAzure.StorageClient (в microsoft.windowsazure.storageclient.dll)

'Применение
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)

Значение свойства

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.


Все открытые статические (Совместно используемая в Visual Basic) члены этого типа являются потокобезопасными. Потокобезопасность членов экземпляров не гарантируется.

Платформы разработки

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

Целевые платформы

Добавления сообщества

Показ:
© 2014 Microsoft