A two-month-old published blog, "Introducing an open source class Excel spreadsheet Software" has sparked a buzz: There are nearly 2000 view, more than 20 reviews in the blog park. At the same time, there are enthusiastic readers how to store Excel cloud files in spreaddesing by reading and loading Excel files in cloud mode. In this article, we are concerned about the cloud storage for the actual practice---based on spreaddesign source code base.
System Prerequisites:
This article chooses the domestic comparatively popular seven qiniu storage.
SpreadDesign.exe has been upgraded to the latest spread Studio 8.35.20143.0 kernel
. NETFramework 4.0
Windows 8.1 64 System
Visual Studio 2013 Community Edition
The list of features to be implemented is as follows:
Register seven Qiniu Storage account (please skip this section if you have an account)
Seven Qiniu Storage-home http://www.qiniu.com/(friendship to seven cattle to make a propaganda, thank you seven cattle to the Grape City control provides seven Qiniu storage coupons)
Seven Cow cloud storage core team members from Shanda, Jinshan, network Dragon, Hewlett-Packard and other well-known internet companies. The core members have been cooperating for many years. Company founder Mr. Xu Xiwei in Jinshan, Baidu and Shanda and other companies as important leadership positions, with many years of practical experience in the storage industry, known as the most suitable for cloud storage of a few people.
Say 7 Cow cloud storage big story! Different from other cloud storage at home and abroad, seven KN self-developed fully distributed architecture solves the risk of other cloud storage single data center architecture, while the first two-way acceleration feature accelerates data upload and download, so that data access speed is higher than average of traditional scheme 50% . In addition, the unique features of the seven Qiniu storage, such as mirrored storage , client through balls , breakpoint upload , cloud rich media processing , and so on, also greatly increase the efficiency of development, minimizing the waste of server resources.
Seven Cattle official Novice road linkExperience Users:
Storage space 1GB
Put request 10,000 times per month
Monthly Download Traffic 1GB
Get request 100,000 times per month
Create 1 spaces
Support for rich media uploads only
To upgrade to a standard user:
Storage space 10GB
Put request 100,000 times per month
Monthly Download Traffic 10GB
Get request 1 million times per month
Create 20 spaces
All features of seven kn are used
7 Qiniu Storage requires 3 information to be used.
1,ak (AccessKey)
2,sk (Secretkey)
3, Bucket
Enter account Settings-key to find the following information:
For a public key and secret key security issue, see where is the official public key? 》
Configure a space (Bucket), as in this article I'm using "grapecity" Space--- space note the case is consistent with the code :
Configuring the Seven Qiniu C # development environment
In the seven Cattle Developer Center, we can see that seven KN offers a number of SDKs:
Click the page to jump to the C # SDK usage guide.
Download the seven KN C # SDK and the third party open source project json.net via the URL provided by the seven cattle website.
Also in the GCDN community, download images are available: http://gcdn.gcpowertools.com.cn/showtopic.aspx?topicid=13778&postid=73156#73156
Configuration is easy, add these 2 DLL references:
Qiniu.DLL
Newtonsoft.Json.dll
Code implementation
Initializing the seven KN SDK code
Qiniu.Conf.Config.ACCESS_KEY = = Bucket = Domain = bucket +;
Note: Access_key, Secret_key Please use the seven-cow admin interface to apply, each can apply for 2 pairs.
List File Listing code
List (ListView listView1, bucket = = = <DumpItem> (items = RSF. Next ())! = (Dumpitem item Stat (ListView listView1, key, bucket = = client. Stat (= ListViewItem (
Note: Key can use file name, Chinese filename is also available.
Delete File code:
Delete (key, bucket = = client. Delete (
Download the file code
DownLoad (key1, domain = BASEURL = private_url ===== NewFile = AppDomain.CurrentDomain.BaseDirectory + =
Designing the Excel Management UI
The "Remote management view" pop-up provides 3 cloud storage-related features:
List: Get the cloud, corresponding to Access_key, Secret_key, bucket files
Delete:: Deleting files from the cloud
DownLoad: Download selected files from the cloud,
Download the cloud files, directly to the Spread.openexcel, can be edited on the spreaddesign, printing, very convenient.
When you're done editing, click "Save to the cloud" and save it in the pop-up dialog box as "locally modified stored files. xlsx", then the program is automatically saved to the cloud.
In the Cloud Content management interface, the refresh can see that the file is automatically uploaded:
Full Source:
Http://git.oschina.net/GrapeCity/SpreadDesigner
Gossip: There are still a few seven qiniu storage of the trial coupon (a seven cow account can only be used once), there is a need to please message communication.
"Introduction of an Open source class Excel spreadsheet Software" continued: Seven Cow cloud storage combat (C #)