本文整理匯總了C#中Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.DownloadTextAsync方法的典型用法代碼示例。如果您正苦於以下問題:C# CloudBlockBlob.DownloadTextAsync方法的具體用法?C# CloudBlockBlob.DownloadTextAsync怎麽用?C# CloudBlockBlob.DownloadTextAsync使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob
的用法示例。
在下文中一共展示了CloudBlockBlob.DownloadTextAsync方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: callback
private static async void callback(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var reb = (RichEditBox)d;
Uri bloburi = new Uri((string)e.NewValue);
CloudBlockBlob cBlob = new CloudBlockBlob(bloburi);
var blobstr = await cBlob.DownloadTextAsync();
reb.Document.SetText(TextSetOptions.FormatRtf, blobstr);
}
示例2: GetContent
/// <summary>
/// Loads the blob text content.
/// </summary>
/// <param name="blob">Documentation article blob.</param>
/// <returns>The blob content as an HTML-encoded string.</returns>
private IHtmlString GetContent(CloudBlockBlob blob)
{
var contents = blob.DownloadTextAsync().Result;
return new HtmlString(contents);
}
示例3: WaitForBlobAndGetStringAsync
public static async Task<string> WaitForBlobAndGetStringAsync(CloudBlockBlob blob)
{
await WaitForBlobAsync(blob);
string result = await blob.DownloadTextAsync(Encoding.UTF8,
null, new BlobRequestOptions(), new Microsoft.WindowsAzure.Storage.OperationContext());
return result;
}
示例4: WaitForBlobAsync
public static async Task<string> WaitForBlobAsync(CloudBlockBlob blob)
{
await TestHelpers.Await(() =>
{
return blob.Exists();
});
string result = await blob.DownloadTextAsync(Encoding.UTF8,
null, new BlobRequestOptions(), new Microsoft.WindowsAzure.Storage.OperationContext());
return result;
}
示例5: ProcessJob
private async Task ProcessJob(CloudBlockBlob jobBlob, CloudBlobContainer container)
{
var name = await jobBlob.DownloadTextAsync();
var result = Compliments.GetRandomCompliment(name);
string resultBlobName = jobBlob.Name.Replace("job/", "result/");
CloudBlockBlob resultBlob = container.GetBlockBlobReference(resultBlobName);
await resultBlob.UploadTextAsync(result);
jobBlob.Metadata["Status"] = "finished";
await jobBlob.SetMetadataAsync();
}
示例6: GetSnapshotStateForVm
private async Task<SnapshotState> GetSnapshotStateForVm(VirtualMachine vm)
{
var snapshotStateUri = vm.StorageProfile.OSDisk.VirtualHardDisk.Uri + ".snapshotstate";
var storageCred = await GetStorageCredentialsForUri(snapshotStateUri);
var blob = new CloudBlockBlob(new Uri(snapshotStateUri), storageCred);
var snapshotState = new SnapshotState();
if (await blob.ExistsAsync())
{
snapshotState = JsonConvert.DeserializeObject<SnapshotState>(await blob.DownloadTextAsync());
}
return snapshotState;
}
示例7: ConvertToCsvLineAsync
private static async Task<string> ConvertToCsvLineAsync(CloudBlockBlob blob)
{
try
{
var blobData = await blob.DownloadTextAsync();
var b = JsonConvert.DeserializeObject<CarState>(blobData);
var result = string.Format("{0},{1},{2},{3},{4},{5},{6}", blob.Name, b.LastUpdatedUtc, b.Speed, b.Latitude, b.Longitude, b.Altitude, b.Heading);
return result;
}
catch (StorageException ex)
{
Console.Error.WriteLine("Error reading blob: {0}", ex);
System.Environment.Exit(1);
return default(string);
}
}
示例8: GetCheckpointAsync
private static async Task<PartitionCheckpoint> GetCheckpointAsync(CloudBlockBlob blob)
{
var text = await blob.DownloadTextAsync().ConfigureAwait(false);
return JsonConvert.DeserializeObject<PartitionCheckpoint>(text);
}