SalesBuy
1-855-856-7678
Technical SupportSupport
The following example returns the collection of page ranges for a page blob and writes them to the console window.
static void GetPageBlobRanges(Uri blobEndpoint, string accountName, string accountKey) { //Create service client for credentialed access to the Blob service. CloudBlobClient blobClient = new CloudBlobClient(blobEndpoint, new StorageCredentialsAccountAndKey(accountName, accountKey)); //Get a reference to the page blob. CloudPageBlob pageBlob = blobClient.GetPageBlobReference("mycontainer/mypageblob"); foreach (PageRange pageRange in pageBlob.GetPageRanges()) { Console.WriteLine("Starting offset: " + pageRange.StartOffset); Console.WriteLine("Ending offset: " + pageRange.EndOffset); Console.WriteLine("Content: " + pageRange.ToString()); Console.WriteLine(); } }
The start and end byte offsets for each page range are inclusive.