Microsoft Azure Storage Explorer
上周主管说,要把每次开过的发票,要下载成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的更多相关文章
- Microsoft Azure Storage Explorer(2)
之前写过一个往Microsoft Azure Storage Explorer里存储的功能,现在又要把东西给下载下来. 记录一下: public string DownFileFromAzure() ...
- 推荐一款跨平台的 Azure Storage Explorer
var appInsights=window.appInsights||function(config){ function r(config){t[config]=function(){var i= ...
- 如何访问Microsoft Azure Storage
首先先要创建存储账户 http://www.cnblogs.com/SignalTips/p/4119128.html 可以通过以下的几个方式访问 通过Visual Studio 2013 Commu ...
- Microsoft Azure Storage Exployer使用指南
概述 Microsoft Azure Storage Exployer 是微软官方推荐的一款管理Azure Storage 客户端工具,客户使用完全免费.支持Windows.Mac和Linux.用户使 ...
- Azure系列2.1 —— com.microsoft.azure.storage.blob
网上azure的资料较少,尤其是API,全是英文的,中文资料更是少之又少.这次由于公司项目需要使用Azure,所以对Azure的一些学习心得做下笔记,文中不正确地方请大家指正. Azure Blob ...
- Microsoft Azure Storage架构分析
Microsoft云存储服务分为两个部分,SQL Azure和Azure Storage.云存储系统的可扩展性和功能不可兼得,必须牺牲一定的关系数据库功能换取可扩展性.Microsoft实现云存储的思 ...
- Azure Queue Storage 基本用法 -- Azure Storage 之 Queue
Azure Storage 是微软 Azure 云提供的云端存储解决方案,当前支持的存储类型有 Blob.Queue.File 和 Table. 笔者在<Azure File Storage 基 ...
- Azure File Storage 基本用法 -- Azure Storage 之 File
Azure Storage 是微软 Azure 云提供的云端存储解决方案,当前支持的存储类型有 Blob.Queue.File 和 Table. 笔者在<Azure Blob Storage 基 ...
- Azure Blob Storage 基本用法 -- Azure Storage 之 Blob
Azure Storage 是微软 Azure 云提供的云端存储解决方案,当前支持的存储类型有 Blob.Queue.File 和 Table. 笔者在<Azure Table storage ...
随机推荐
- linux中文man手册安装
1.下载源码 源码网址 https://src.fedoraproject.org/repo/pkgs/man-pages-zh-CN/ 下载源码 wget https://src.fedorapro ...
- Beetl学习总结(3)——高级功能
3.1. 配置GroupTemplate Beetl建议通过配置文件配置配置GroupTemplate,主要考虑到未来可能IDE插件会支持Beetl模板,模板的属性,和函数等如果能通过配置文件获取,将 ...
- The merchant
The merchant Time Limit: 3000MS Memory Limit: 65536K Description There are N cities in a cou ...
- [繁华模拟赛]Evensgn 剪树枝
Evensgn 剪树枝 题目 繁华中学有一棵苹果树.苹果树有 n 个节点(也就是苹果),n − 1 条边(也就 是树枝).调皮的 Evensgn 爬到苹果树上.他发现这棵苹果树上的苹果有两种:一 种是 ...
- EPEL reporsitory
在centos 5上yum install git的时候报错说没有git这个package. 这是因为centos的软件策略非常保守,因为它基本就是redhat企业版的copy.所以想在centos5 ...
- firedac数据集控件的公共祖先类——TFDAdaptedDataSet
firedac数据集控件的公共祖先类——TFDAdaptedDataSet TFDQuery = class(TFDCustomQuery)TFDCustomQuery = class(TFDRdbm ...
- Codeforces Round #305 (Div. 2) C题 (数论)
C. Mike and Frog time limit per test 1 second memory limit per test 256 megabytes input standard inp ...
- 阿里2016实习offer五面经验与总结
前言 眼下楼主已经拿到阿里实习offer,一共经历了5次面试,当中4轮技术面.1轮HR面试.在这里分享一下自己的面试经验和学习总结.写这篇面经主要是希望可以帮助很多其它的小伙伴.我本科毕业于中南大学信 ...
- uva 11605 - Lights inside a 3d Grid(概率)
option=com_onlinejudge&Itemid=8&page=show_problem&problem=2652" style=""& ...
- uboot向内核模块传递参数的方法
1 模块参数 定义模块参数 1 module_param(name, type, perm); 定义一个模块参数, name 变量名 type 数据类型 bool:布尔型 invbool:一个布尔型( ...