[英]How do I read the content of a txt file in Azure Storage Container?
I have an container in my Azure storage and i just want to read the content of the txt files and the date the file was created. 我的Azure存储中有一个容器,我只想读取txt文件的内容和文件的创建日期。 I do not wish to download the file itself.
我不希望下载文件本身。 i found some answers to that but the once i found where out of date.
我找到了一些答案,但有一次我发现过时了。
Downloading the file and reading the content is essentially the same thing, just wording. 下载文件和阅读内容本质上是同一件事,只是措辞而已。 No need to save the file physically to disk.
无需将文件物理保存到磁盘。 You can do a .DownloadText() on your CloudBlockBlob object, which returns a string.
您可以在CloudBlockBlob对象上执行.DownloadText(),该对象返回一个字符串。
var cloudBlockBlob = GetCloudBlockBlob();
cloudBlockBlob.FetchAttributes();
var created = cloudBlockBlob.Properties.Created;
var content = cloudBlockBlob.DownloadText();
You obviously need to implement your own GetCloudBlockBlob() method. 您显然需要实现自己的GetCloudBlockBlob()方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.