且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何连接Azure存储读取.TXT从Blob存储文件

更新时间:2023-02-08 23:27:47

这是pretty容易:

It's pretty easy:

string text = CloudStorageAccount.Parse("<your connection string>").CreateCloudBlobClient().GetBlobReference("path/to/the/blob.txt").DownloadText();

当然,如果BLOB是在一个公共的容器,你可以做:

Of course, if the blob is in a public container, you can just do:

string text = new WebClient().DownloadString("http://youraccount.blob.core.windows.net/path/to/blob.txt");