当前位置: 首页>>代码示例>>C#>>正文


C# CloudBlockBlob.DownloadText方法代码示例

本文整理汇总了C#中Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.DownloadText方法的典型用法代码示例。如果您正苦于以下问题:C# CloudBlockBlob.DownloadText方法的具体用法?C# CloudBlockBlob.DownloadText怎么用?C# CloudBlockBlob.DownloadText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob的用法示例。


在下文中一共展示了CloudBlockBlob.DownloadText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSasToken

        public void GetSasToken()
        {
            var sasuri = TokenGenerator.GetBlobSasUri(Container, "messageType/queue/2015-06-20/filename_21-58-40_fc5ebd3b-ca42-41fb-abec-842db13ccd4b.xml");

            CloudBlockBlob cloudBlockBlob = new CloudBlockBlob(new Uri(sasuri));

            string text = cloudBlockBlob.DownloadText();
        }
开发者ID:iremmats,项目名称:sb-largemessage,代码行数:8,代码来源:Tests.cs

示例2: Main

        static void Main(string[] args)
        {
            var blobName = args[0];
            var blobUri = new Uri(blobName);
            var numTopN = int.Parse(args[1]);

            var blob = new CloudBlockBlob(blobUri);
            var content = blob.DownloadText();
            var words = content.Split(' ');
            var topNWords = words.Where(word => word.Length > 0)
                .GroupBy(word => word, (key, group) => new KeyValuePair<string, long>(key, group.LongCount()))
                .OrderByDescending(x => x.Value)
                .Take(numTopN)
                .ToList();

            foreach (var pair in topNWords)
            {
                Console.WriteLine("{0} {1}", pair.Key, pair.Value);
            }
        }
开发者ID:michaeldtaylor,项目名称:BatchPlayground,代码行数:20,代码来源:Program.cs

示例3: DownloadResults

        private void DownloadResults(string key, AzureBlobDataReference blobLocation)
        {
            if (_outputDestination != DestinationType.None)
            {
                var credentials = new StorageCredentials(blobLocation.SasBlobToken);
                var cloudBlob = new CloudBlockBlob(new Uri(new Uri(blobLocation.BaseLocation), blobLocation.RelativeLocation), credentials);

                if (_outputDestination == DestinationType.FileConnection)
                {
                    ConnectionManager connectionManager = _connections[_destination];
                    var connection = (object)null;

                    try
                    {
                        connection = connectionManager.AcquireConnection(null);

                        string filePath = connection.ToString();

                        cloudBlob.DownloadToFile(filePath, FileMode.Create);
                    }
                    finally
                    {
                        if (connection != null && connectionManager != null)
                            connectionManager.ReleaseConnection(null);
                    }
                }
                else if (_outputDestination == DestinationType.Variable)
                {
                    var variables = (Variables)null;
                    _variableDispenser.LockOneForWrite(_destination, ref variables);

                    try
                    {
                        var variable = variables[_destination];

                        if (variable != null)
                        {
                            variable.Value = cloudBlob.DownloadText();
                        }
                    }
                    finally
                    {
                        if (variables != null)
                            variables.Unlock();
                    }
                }

                _componentEvents.FireInformation(0, "ExecuteAzureMLBatch",
                    string.Format("The result '{0}' is available: BaseLocation: '{1}' RelativeLocation: '{2}' SasBlobToken: '{3}'",
                        key,
                        blobLocation.BaseLocation,
                        blobLocation.RelativeLocation,
                        blobLocation.SasBlobToken),
                    null, 0, ref fireAgain);
            }
        }
开发者ID:IgnEriol,项目名称:AzureMLSSIS,代码行数:56,代码来源:ExecuteAzureMLBatch.cs

示例4: GetBlobData

 static string GetBlobData(CloudBlockBlob cloudBlockBlob)
 {
     return cloudBlockBlob.DownloadText(TextEncoding, new AccessCondition(),
         new BlobRequestOptions { RetryPolicy = new ExponentialRetry() }, new OperationContext());
 }
开发者ID:RichieYang,项目名称:Rebus,代码行数:5,代码来源:AzureStorageSagaSnapshotStorage.cs


注:本文中的Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.DownloadText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。