private void btnHeadBlob_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; AzureBlobStorage abs = new AzureBlobStorage(txtAccount.Text, string.Format("http://{0}.blob.core.windows.net", txtAccount.Text), txtSharedKey.Text, "SharedKey"); azureResults ar = new azureResults(); ar= abs.Blobs(cmdType.head,cbBlobContainers.Text, cbBlobs.Text, new Hashtable(), ""); ProcessResults(ar); this.Cursor = Cursors.Default; }
private void GetBlobData(string containerName, string blobName) { this.Cursor = Cursors.Wait; resetBlobContainerText(); containerDataPanel.Visibility = System.Windows.Visibility.Collapsed; blobDataPanel.Visibility = System.Windows.Visibility.Visible; AzureBlobStorage abs = new AzureBlobStorage(azAccount, string.Format("http://{0}.blob.core.windows.net", azAccount), azSharedKey, "SharedKey"); azureResults ar = abs.Blobs(cmdType.head, containerName, blobName, new Hashtable(), ""); ProcessResults(ar); // load detail pane StringBuilder sbMeta = new StringBuilder(); txtBlobContainerUrl.Text = ar.Url; foreach (DictionaryEntry item in ar.Headers) { if (item.Key.ToString().StartsWith("x-ms-meta")) // need to populate metadata { sbMeta.AppendLine(string.Format("{0}:{1}", item.Key.ToString(), item.Value.ToString())); } switch (item.Key.ToString()) { case "Content-Encoding": txtContentEncoding.Text = item.Value.ToString(); break; case "Content-Length": txtBlobSize.Text = item.Value.ToString(); break; case "Content-MD5": txtBlobMD5.Text = item.Value.ToString(); break; case "Content-Type": txtContentType.Text = item.Value.ToString(); break; case "ETag": txtETag.Text = item.Value.ToString(); break; case "Last-Modified": txtLastModified.Text = item.Value.ToString(); break; case "x-ms-blob-type": txtBlobType.Text = item.Value.ToString(); break; case "x-ms-lease-duration": txtLeaseDuration.Text = item.Value.ToString(); break; case "x-ms-lease-state": txtLeaseState.Text = item.Value.ToString(); break; case "x-ms-lease-status": txtLeaseStatus.Text = item.Value.ToString(); break; case "x-ms-version": txtblobContainerVersion.Text = item.Value.ToString(); break; } } txtBlobContainerHeaders.Text = sbMeta.ToString(); }