當前位置: 首頁>>代碼示例>>C#>>正文


C# CloudBlockBlob.DownloadTextAsync方法代碼示例

本文整理匯總了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);
 }
開發者ID:Myfreedom614,項目名稱:UWP-Samples,代碼行數:8,代碼來源:RtfText.cs

示例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);
        }
開發者ID:normesta,項目名稱:vs-cordova-docs-sample,代碼行數:11,代碼來源:DocumentationController.cs

示例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;
        }
開發者ID:Azure,項目名稱:azure-webjobs-sdk-script,代碼行數:9,代碼來源:TestHelpers.cs

示例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;
        }
開發者ID:isaacabraham,項目名稱:azure-webjobs-sdk-script,代碼行數:12,代碼來源:TestHelpers.cs

示例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();
        }
開發者ID:rolandkru,項目名稱:bbvAcademyAzure,代碼行數:13,代碼來源:Lab1Worker.cs

示例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;
 }
開發者ID:rupertbenbrook,項目名稱:AzureVmProvisioningSite,代碼行數:12,代碼來源:VmManager.cs

示例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);
            }
        }
開發者ID:smartpcr,項目名稱:data-pipeline,代碼行數:17,代碼來源:Program.cs

示例8: GetCheckpointAsync

 private static async Task<PartitionCheckpoint> GetCheckpointAsync(CloudBlockBlob blob)
 {
     var text = await blob.DownloadTextAsync().ConfigureAwait(false);
     return JsonConvert.DeserializeObject<PartitionCheckpoint>(text);
 }
開發者ID:smartpcr,項目名稱:iot-journey,代碼行數:5,代碼來源:PartitionCheckpointManager.cs


注:本文中的Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.DownloadTextAsync方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。