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


C# CloudBlockBlob.DeleteIfExists方法代码示例

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

示例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);
        }
开发者ID:nexbit,项目名称:Brisebois.WindowsAzure,代码行数:10,代码来源:BlobSnapshotCleaner.cs

示例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);
     }
 }
开发者ID:modulexcite,项目名称:StudentSuccessDashboard,代码行数:11,代码来源:AzureBlobContainer.cs

示例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);
                }
            }
        }
开发者ID:pimbrouwers,项目名称:JohnnyCache.NET,代码行数:23,代码来源:AzureBlob.cs

示例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();
        }
开发者ID:mg-alfa-dev,项目名称:DeployToAzure,代码行数:10,代码来源:Program.cs


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