c# - Upload a Single File to Blob Storage Azure -
how can upload file c# ? need upload file dialogwindow.
using microsoft.windowsazure.storage; using microsoft.windowsazure.storage.auth; using microsoft.windowsazure.storage.blob; // retrieve storage account connection string. cloudstorageaccount storageaccount = cloudstorageaccount.parse("storagekey"); // create blob client. cloudblobclient blobclient = storageaccount.createcloudblobclient(); // retrieve reference created container. cloudblobcontainer container = blobclient.getcontainerreference("mycontainer"); // retrieve reference blob named "myblob". cloudblockblob blockblob = container.getblockblobreference("myblob"); // create or overwrite "myblob" blob contents local file. using (var filestream = system.io.file.openread(@"path\myfile")) { blockblob.uploadfromstream(filestream); }
see here needed sdk , references
i think it's need
Comments
Post a Comment