本文整理汇总了C#中Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.DeleteIfExists方法的典型用法代码示例。如果您正苦于以下问题:C# CloudBlockBlob.DeleteIfExists方法的具体用法?C# CloudBlockBlob.DeleteIfExists怎么用?C# CloudBlockBlob.DeleteIfExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob
的用法示例。
在下文中一共展示了CloudBlockBlob.DeleteIfExists方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteBackup
private void DeleteBackup(CloudBlockBlob blob)
{
Log.Info("Deleting Blob: {0}", blob.Uri.AbsoluteUri);
if (!WhatIf)
{
blob.DeleteIfExists(DeleteSnapshotsOption.IncludeSnapshots, accessCondition: AccessCondition.GenerateIfMatchCondition(blob.Properties.ETag));
}
}
示例2: OnExecuting
protected override void OnExecuting(CloudBlockBlob workItem)
{
if (workItem == null)
throw new ArgumentNullException("workItem");
workItem.DeleteIfExists();
string message = string.Format(CultureInfo.InvariantCulture, Resources.SnapshotCleaner_Deleted_Snapshot_Confirmation, workItem.Uri, workItem.SnapshotTime);
Report(message);
}
示例3: DeleteIfExists
private static void DeleteIfExists(CloudBlockBlob blob)
{
try
{
blob.DeleteIfExists();
}
catch (StorageException e)
{
throw new BlobException(string.Format(CultureInfo.InvariantCulture, "Could not DeleteIfExists blob named '{0}' from container. See inner exception for details.", blob.Name), e);
}
}
示例4: DeleteBlob
private static void DeleteBlob(CloudBlockBlob blockBlob)
{
int attempt = 0;
int MaxAttempts = 3;
while (++attempt <= MaxAttempts)
{
try
{
blockBlob.DeleteIfExists();
break;
}
catch (Exception ex)
{
if (attempt == MaxAttempts)
{
throw ex;
}
Thread.Sleep(100);
}
}
}
示例5: DeleteBlob
private static void DeleteBlob(string packageUrl, string storageAccountName, string storageAccountKey)
{
OurTrace.TraceInfo(string.Format("Deleting blob {0}", packageUrl));
var packageUri = new Uri(packageUrl);
var credentials = new StorageCredentials(storageAccountName, storageAccountKey);
var blobRef = new CloudBlockBlob(packageUri, credentials);
blobRef.DeleteIfExists();
}