上周主管说,要把每次开过的发票,要下载成Pdf的文件,然后就实时的将这些发票存到云上面去。

就是这个Microsoft Azure ,微软的亲儿子。

先把代码贴上来吧,挺简单的。

 ##.链接账号密码
StorageCredentials storageCredentials = new StorageCredentials(
System.Configuration.ConfigurationManager.AppSettings["Blob_AccountName"].ToString(),
System.Configuration.ConfigurationManager.AppSettings["Blob_AccountKey"].ToString()
);
CloudStorageAccount storageAccount = new CloudStorageAccount(storageCredentials, "core.chinacloudapi.cn", true);
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container;
CloudBlockBlob blockBlob = null;//怎么去实例化声明
##.下面这个就是将文件上传到Blob中,这个acsh是你的容器的名字,后面加上"/" 就是路径了,我写的这个是年月日的文件夹
 container = blobClient.GetContainerReference("acsh/" + DateTime.Now.Year + "/" + DateTime.Now.Month + "/" + DateTime.Now.Day + ""); ##.FPQQLSH这个是你传到云里的文件夹的名称。
blockBlob = container.GetBlockBlobReference(FPQQLSH);
##. 文件以byte2stream(fileByte)的形式"流"传入
byte[] fileByte = Convert.FromBase64String(Convert.ToBase64String(PDF_FILE));
blockBlob.UploadFromStreamAsync(byte2stream(fileByte));

上面加粗的就是一个路径,为了考虑到以后方便备份和迁移,在Blob容器中创建这种带有这种年月日的文件夹。

一开始在本地用Code去想了最原始的方法,就是先在本地去创建一个年月日的文件夹,还找了许多代码,最后还是不行。

不能跑一个程序就创建一个文件夹吧,到时候大批量的发票就辣么多的文件夹那可就gg了。

然后,就想到直接怼路径咋样,咦~,丢雷亩啊~~~~~~居然行了。。。

Microsoft Azure Storage Explorer的更多相关文章

  1. Microsoft Azure Storage Explorer(2)

    之前写过一个往Microsoft Azure Storage Explorer里存储的功能,现在又要把东西给下载下来. 记录一下: public string DownFileFromAzure() ...

  2. 推荐一款跨平台的 Azure Storage Explorer

    var appInsights=window.appInsights||function(config){ function r(config){t[config]=function(){var i= ...

  3. 如何访问Microsoft Azure Storage

    首先先要创建存储账户 http://www.cnblogs.com/SignalTips/p/4119128.html 可以通过以下的几个方式访问 通过Visual Studio 2013 Commu ...

  4. Microsoft Azure Storage Exployer使用指南

    概述 Microsoft Azure Storage Exployer 是微软官方推荐的一款管理Azure Storage 客户端工具,客户使用完全免费.支持Windows.Mac和Linux.用户使 ...

  5. Azure系列2.1 —— com.microsoft.azure.storage.blob

    网上azure的资料较少,尤其是API,全是英文的,中文资料更是少之又少.这次由于公司项目需要使用Azure,所以对Azure的一些学习心得做下笔记,文中不正确地方请大家指正. Azure Blob ...

  6. Microsoft Azure Storage架构分析

    Microsoft云存储服务分为两个部分,SQL Azure和Azure Storage.云存储系统的可扩展性和功能不可兼得,必须牺牲一定的关系数据库功能换取可扩展性.Microsoft实现云存储的思 ...

  7. Azure Queue Storage 基本用法 -- Azure Storage 之 Queue

    Azure Storage 是微软 Azure 云提供的云端存储解决方案,当前支持的存储类型有 Blob.Queue.File 和 Table. 笔者在<Azure File Storage 基 ...

  8. Azure File Storage 基本用法 -- Azure Storage 之 File

    Azure Storage 是微软 Azure 云提供的云端存储解决方案,当前支持的存储类型有 Blob.Queue.File 和 Table. 笔者在<Azure Blob Storage 基 ...

  9. Azure Blob Storage 基本用法 -- Azure Storage 之 Blob

    Azure Storage 是微软 Azure 云提供的云端存储解决方案,当前支持的存储类型有 Blob.Queue.File 和 Table. 笔者在<Azure Table storage ...

随机推荐

  1. [luogu2591 ZJOI2009] 函数

    传送门 Solution 画图找规律.. Code //By Menteur_Hxy #include <cstdio> #define min(a,b) ((a)>(b)?(b): ...

  2. 第八节:numpy之四则运算与逻辑运算

  3. Sum of Medians

    Sum of Medians time limit per test 3 seconds memory limit per test 256 megabytes In one well-known a ...

  4. ClassCastException:ColorDrawable cannot be cast to RoundRectDrawableWithShadow

    错误信息 java.lang.ClassCastException: android.graphics.drawable.ColorDrawable cannot be cast to android ...

  5. 2.3. Configuring sudo Access-RedHat

    https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/2/html/Get ...

  6. SSM(spring mvc+spring+mybatis)学习路径——1-2、spring事务管理

    目录 1-2 Spring事务管理 概念介绍 事务回顾 事务的API介绍 Spring 事务管理 转账案例 编程式事务管理 声明式事务管理 使用XML配置声明式事务 基于tx/aop 使用注解配置声明 ...

  7. oracle latch

    (转载 : http://www.dbtan.com/2010/05/latch-free.html) Latch Free(闩锁释放):Latch Free通常被称为闩锁释放,这个名称常常引起误解, ...

  8. Java开发中的几种对象的说明(PO,VO,DTO,BO,POJO,DAO,SAO等)

    一.PO :(persistant object ),持久对象 可以看成是与数据库中的表相映射的java对象.使用Hibernate来生成PO是不错的选择. 二.VO :(value object) ...

  9. Cocoa pods的安装和使用

    现在网上关于cocoapods的安装使用资料有很多,有些方法能用,有些是用不了的,别问为什么,因为我就是从坑里走出来的.在此自己整理了一些方法: 一般需要先升级Ruby环境: 第一步:安装rvm $  ...

  10. CF 557A(Ilya and Diplomas-贪心)

    A. Ilya and Diplomas time limit per test 1 second memory limit per test 256 megabytes input standard ...