本文整理汇总了C#中Microsoft.WindowsAzure.Storage.Blob.CloudPageBlob.Exists方法的典型用法代码示例。如果您正苦于以下问题:C# CloudPageBlob.Exists方法的具体用法?C# CloudPageBlob.Exists怎么用?C# CloudPageBlob.Exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.WindowsAzure.Storage.Blob.CloudPageBlob
的用法示例。
在下文中一共展示了CloudPageBlob.Exists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PollVHDBlob
/// <summary>
/// Wait for the VHD Blob to disappear in order to confirm the VM and its OS disk were deleted.
/// </summary>
/// <param name="pollIntervalSeconds"></param>
/// <param name="action"></param>
internal void PollVHDBlob(int pollIntervalSeconds, Action action)
{
//var account = new CloudStorageAccount(new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials(_parameters.StorageAccountName, _primaryKey), true);
//var client = account.CreateCloudBlobClient();
var blobName = String.Format("https://{0}.blob.core.windows.net/vhds/{1}", _parameters.StorageAccountName, _parameters.VMName);
var blob = new CloudPageBlob(new Uri(blobName), new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials(_parameters.StorageAccountName, _primaryKey));
while (true)
{
// Break if the Blob has disappeared
if (!blob.Exists()) break;
// Execute the action
action();
// Wait a while
System.Threading.Thread.Sleep(pollIntervalSeconds * 1000);
}
}