當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。