当前位置: 首页>>代码示例>>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;未经允许,请勿转载。