csharp 上传到azure.cs

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 上传到azure.cs相关的知识,希望对你有一定的参考价值。

// Retrieve storage account from connection string.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
    CloudConfigurationManager.GetSetting("StorageConnectionString"));

// Create the blob client.
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

// Retrieve reference to a previously created container.
CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");

// Retrieve reference to a blob named "myblob".
CloudBlockBlob blockBlob = container.GetBlockBlobReference("newfile.jpg");

var ms = new MemoryStream();

ImageBuilder.Current.Build("~/originalFile.jpg", ms, new ResizeSettings("width=3200&height=3200&format=jpg"));

ms.Seek(0,SeekOrigin.Begin);

blockBlob.UploadFromStream(ms);

以上是关于csharp 上传到azure.cs的主要内容,如果未能解决你的问题,请参考以下文章

csharp上传大型视频文件到服务器,解决方案

csharp上传大型视频文件到服务器,解决方案

csharp 上传文件并将其作为附件发送到电子邮件#email #attachment

csharp 上传文件#CSharp

csharp文件分片上传,断点续传

csharp 上传的文件限制(IIS Express)