I am using azure blob storage. I stored an txt file in the storage, and now i am trying to read it through :
StreamReader reader = new StreamReader(Blob.Uri.AbsoluteUri);
Blob containes the reference of the blob where txt file is stored.
But here i am getting the exception (URI formats are not supported.). I think the streamreader does’nt support the URI formate. Can anybody please give me a better work arround for this ?
( i know one that we can use DowmloadToFile method of CloudBlob to download the file and then create an address by using Server.MapPath and put that address instead of URI. But if there is any other better solution for this then please let me know )
Take a look at WebClient.OpenRead or WebClient.DownloadString methods.
Your code will looks like something like that :
Or if the file is small (text files are often small), :