當前位置: 首頁>>代碼示例>>C#>>正文


C# CloudBlob.DeleteIfExists方法代碼示例

本文整理匯總了C#中Microsoft.WindowsAzure.StorageClient.CloudBlob.DeleteIfExists方法的典型用法代碼示例。如果您正苦於以下問題:C# CloudBlob.DeleteIfExists方法的具體用法?C# CloudBlob.DeleteIfExists怎麽用?C# CloudBlob.DeleteIfExists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Microsoft.WindowsAzure.StorageClient.CloudBlob的用法示例。


在下文中一共展示了CloudBlob.DeleteIfExists方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: appendToBlob

        private const string MimeTypeName = "text/plain"; // since these are assumed to

        #endregion Fields

        #region Methods

        /// <summary>
        /// ugliness of downloading and reuploading whole blob.
        /// </summary>
        /// <param name="blob"></param>
        /// <param name="toAdd"></param>
        public static void appendToBlob(CloudBlob blob, string toAdd)
        {
            string oldLogData = "";
            if (Exists(blob))
                oldLogData = blob.DownloadText();
            blob.DeleteIfExists();
            blob.UploadText(oldLogData + "\r\n" + toAdd);
        }
開發者ID:valkiria88,項目名稱:Astoria,代碼行數:19,代碼來源:BlobLibrary.cs

示例2: Delete

 /// <summary>
 /// Удаляет файл.
 /// </summary>
 /// <param name="localUri"> Адрес файла </param>
 public void Delete(string localUri)
 {
     CloudBlob blob = new CloudBlob(localUri, _client);
     blob.DeleteIfExists(new BlobRequestOptions()
     {
         RetryPolicy = RetryPolicies.RetryExponential(
             RetryPolicies.DefaultClientRetryCount,
             RetryPolicies.DefaultClientBackoff)
     });
 }
開發者ID:retran,項目名稱:old-projects-backup,代碼行數:14,代碼來源:BlobServiceImplementor.cs

示例3: MoveBlob

        internal static void MoveBlob(CloudBlob blob, string topath = "", string currentpath = "")
        {
            // Retrieve stroage account from connection string
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("StorageConnectionString"));

            // Create the blob client
            CloudBlobClient client = storageAccount.CreateCloudBlobClient();

            CloudBlobContainer blobContainer = null;
            CloudBlobDirectory toFolder = null;

            CloudBlob newblob = null;

            if (topath.Contains('/')) {
                toFolder = client.GetBlobDirectoryReference(topath);
                string filepath = blob.Name.Substring(blob.Name.IndexOf("/") + 1);
                newblob = toFolder.GetBlobReference(filepath);
            } else {
                blobContainer = client.GetContainerReference(topath);
                string filepath = blob.Name.Substring(blob.Name.IndexOf("/") + 1);
                newblob = blobContainer.GetBlobReference(filepath);
            }
            newblob.UploadByteArray(blob.DownloadByteArray());
            blob.DeleteIfExists();
        }
開發者ID:meganmcchesney,項目名稱:CURTeCommerce,代碼行數:25,代碼來源:BlobManagement.cs

示例4: CreateFileNotExistsTaskRunner

		public TaskRunner CreateFileNotExistsTaskRunner(CloudBlob blob, string basePath)
		{
			this._statistics.FileNotExistCount++;
			return new SingleActionTaskRunner(() =>
			{
				string relativePath = blob.GetRelativeFilePath();
				string fullFilePath = this._fileSystem.Combine(basePath, relativePath);

				_messageBus.Publish(new FileProgressedMessage(fullFilePath, 0));
				blob.DeleteIfExists();
				_messageBus.Publish(new FileProgressedMessage(fullFilePath, 1));
			});
		}
開發者ID:devsda0,項目名稱:AzureBackup,代碼行數:13,代碼來源:UploadSyncronizationProvider.cs


注:本文中的Microsoft.WindowsAzure.StorageClient.CloudBlob.DeleteIfExists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。