Skip to content

Commit

Permalink
Merge pull request #136 from fengyhack/master
Browse files Browse the repository at this point in the history
版本更新v7.2.7:新增UWP支持,新增async支持
  • Loading branch information
fengyhack committed Feb 6, 2017
2 parents ea54ffb + 08a4b85 commit 98a64c7
Show file tree
Hide file tree
Showing 63 changed files with 24,278 additions and 1,102 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,15 @@
**2017-02-06**

最新版本v7.2.7,适用于.NET Framework 2.0+ , .NET Core 和 UWP

新增:对于UWP(Windows10)的支持

新增:对于.NET Framework 4.5及以上, .NET Core和UWP的“异步(async)”支持

更新:部分类、属性、方法名称等细节修改,请参见SDK文档或者使用指南

* * *

**2017-01-20**

最新版本v7.2.6,适用于.NET Framework 2.0+ 和.NET Core
Expand Down
2 changes: 1 addition & 1 deletion Qiniu.Net40.Travis.sln
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qiniu.Net40", "src\Qiniu\Qiniu.Net40.Travis.csproj", "{2F5B0328-DE8B-4B53-A500-3077E340A51B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qiniu.Net40.Travis", "src\Qiniu\Qiniu.Net40.Travis.csproj", "{2F5B0328-DE8B-4B53-A500-3077E340A51B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
227 changes: 227 additions & 0 deletions README.en-US.md
@@ -0,0 +1,227 @@
#Qiniu (Cloud) C# SDK

[![Build Status](https://api.travis-ci.org/qiniu/csharp-sdk.png?branch=master)](https://travis-ci.org/qiniu/csharp-sdk)

##About

This C# SDK is built based on Qiniu Cloud API (see below), and it can be used on .NET Framework 2.0+, .NET Core and UWP (Windows 10 Universal Platforms). It will help you to build an application easily and quickly.

##Documentation

You can have a better view of this SDK by checking the documnets given below:

* [SDK-reference HTML Online](http://oiy037d6a.bkt.clouddn.com/csharp-sdk-ref-v7.2.7/index.html)

* [SDK-reference CHM Offline](http://oiy037d6a.bkt.clouddn.com/QiniuCSharpSDK-Ref-v7.2.7.chm)

Want to know more about how to using this SDK? Are you trying to find some code examples based on this SDK? These documents or links below will be helpful:

* [github/csharp-sdk-shared-examples](https://github.com/fengyhack/csharp-sdk-shared-examples)

* [SDK manual | examples](http://oiy037d6a.bkt.clouddn.com/csharp-sdk-man-v7.2.7/index.html)

##How-to-install

Releases can be found [here](https://github.com/fengyhack/csharp-sdk-shared/releases), choose the one you need and unzipped it, then add reference to the *.dll file in your project.

The latest update will always be available in the `master` branch.

Or you can install using NuGet, take Visual Studio 2013/2015 as an example, navigate to the NuGet package manager, and search `Qiniu.Shared`, or just type the scriptin the package manager console as follow:

```
Install-Package Qiniu.Shared
```

And of course, you can build totally from source.

##How-to-build

Suppose you are using Visual Studio(VS2013 and higher versions are strongly recommended) to build this SDK.

| Target | Solution file |
|--------|--------|
| .NET Framework 2.0 | Qiniu.Net20.sln |
| .NET Framework 3.5 | Qiniu.Net35.sln |
| .NET Framework 4.0 | Qiniu.Net40.sln |
| .NET Framework 4.5 | Qiniu.Net45.sln |
| .NET Framework 4.6 | Qiniu.Net46.sln |
| .NET Core | Qiniu.NetCore.sln |
| Windows10 UWP | Qiniu.UWP.sln |
| All the above | Qiniu.ALL_VER.sln |

**Some details about building NetCore/UWP projects**

If you want to build `Qiniu.NetCore` or `Qiniu.UWP`, please copy `project.json` and `project.lock.json` (from `Qiniu.Core` or `Qiniu.UWP` folder) into `Qiniu` folder firstly, or you can just copy `project.json` and then execute `dotnet restore` command (a better way)。

For the other platforms, please delete `project.json` and `project.lock.json` in `Qiniu` folder.

##Notes on .NET Framework

**Higher version targets support async but lower ones doesn't**.

For lower version targets (.NET framework 2.0/3.0/3.5/4.0), HTTP operations is performed with `HttpWebRequest`/`HttpWebResponse` and does not support `async` operations. It should be clear that file/stream read/write functions in these targets do not support async as well.

For higher version targets (.NET Framework 4.5+, .NET Core, and UWP), HTTP operations is performed with `HttpClient` which supports `async` originally. In this case, file/stream read/write operations are implemented with async support.

##API reference

* [Storage API documentation](http://developer.qiniu.com/article/index.html#kodo-api-handbook)

* [Processing API documentation](http://developer.qiniu.com/article/index.html#dora-api-handbook)

* [Fusion CDN API documentation](http://developer.qiniu.com/article/index.html#fusion-api-handbook)

##Related resources

Good ideas and suggestions about our documentation or products are well appreciated. Welcome to visit the websites below and you may leave your words if you like.

* [Forum](http://segmentfault.com/qiniu) - You can share your ideas with each other here, talking abouthow to use Qiniu product or other related topics.

* [Request](http://support.qiniu.com/hc/request/guest/) - If the problems you post on the forum are still unsolved, you can submit it here, tech-support will give you a response as soon as posible.

* [Blog](http://blog.qiniu.com/) - Latest articles about activities and technical sharing can be found here.

* [Weibo](http://weibo.com/qiniutek)

* [FAQs](http://developer.qiniu.com/article/faqs/)

##Contribution

1. Fork

2. Create your own branch `git checkout -b my-new-feature`

3. Commit you changes `git commit -am 'Added some feature'`

4. Push your commit to the remote repo `git push origin my-new-feature`

5. Visit your github page and make a new `pull request` in your branmch `my-new-feature`


##License

Copyright (c) 2017 [qiniu.com](www.qiniu.com)

Published using on MIT license:

www.opensource.org/licenses/MIT

##Appendix

###Quick start on .NET Coree

### How-to-use

Here is a step-by-step guide.

To get ready, if you need `dotnet` tool, see https://github.com/dotnet/cli/

####1. Create

Firstly, change to the working folder, and then create a project:

dotnet new
dotnet restore

**NOTE** that before `dotnet restore` you may modify the generated `project.json` file as follow:

```json
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true
},

"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1"
},
"Qiniu": "7.1.0.0",
"Newtonsoft.Json": "9.0.1"
},

"frameworks": {
"netcoreapp1.0": {
"imports": "dnxcore50"
}
},

"runtimes": {
"win7-x64": {},
"win7-x86": {},
"osx.10.10-x64": {},
"osx.10.11-x64": {},
"ubuntu.14.04-x64": {},
"ubuntu.16.04-x64": {}
}
}
```

Then write your codes.

#### 2. Publish

You may publish to the target os using command like one of them:

```script
dotnet publish -r win7-x64
dotnet publish -r ubuntu.16.04-x64
dotnet publish -r osx.10.11-x64
```

Or if you have .NET Core runtime installed, just build:

```script
dotnet build
```

#### 3. Run

**NOTE that on OSX 10.11(EI Capitan)**, openssl must be installed before running your app:

```script
brew update
brew install openssl
brew link --force openssl
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
```

Say, if you would like to run the *built app* `Example.dll`, just type:

```script
dotnet Example.dll
```

Or if you publish on Windows and exe file if generated, just run the exe file.

In this case, you should have `dotnet` tool installed at the very begin.

Or if you want to run the *published app* `Example`, just double-click it.

######Quick start on .NET Coree

**What is UWP**

UWP means (Windows 10) Universal Windows Platform.

UWP project also contains a file called `project.json`, here is an example:

```json
{
"dependencies": {
"Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0"
},
"frameworks": {
"uap10.0": {}
},
"runtimes": {
"win10-arm": {},
"win10-arm-aot": {},
"win10-x86": {},
"win10-x86-aot": {},
"win10-x64": {},
"win10-x64-aot": {}
}
}
```
41 changes: 34 additions & 7 deletions README.md
Expand Up @@ -4,21 +4,21 @@

##关于

此 C# SDK 适用于.NET Framework 2.0+ .NET Core,基于七牛云API参考手册构建。使用此 SDK 构建您的网络应用程序,能让您以非常便捷地方式将数据安全地存储到七牛云存储上。无论您的网络应用是一个网站程序,还是包括从云端(服务端程序)到终端(手持设备应用)的架构的服务或应用,通过七牛云存储及其 SDK,都能让您应用程序的终端用户高速上传和下载,同时也让您的服务端更加轻盈。
此 C# SDK 适用于.NET Framework 2.0+ , .NET Core 以及UWP(Windows 10 通用应用),基于七牛云API参考手册构建。使用此 SDK 构建您的网络应用程序,能让您以非常便捷地方式将数据安全地存储到七牛云存储上。无论您的网络应用是一个网站程序,还是包括从云端(服务端程序)到终端(手持设备应用)的架构的服务或应用,通过七牛云存储及其 SDK,都能让您应用程序的终端用户高速上传和下载,同时也让您的服务端更加轻盈。

##SDK文档

以下文档用于检索SDK接口、属性说明,它将有助于您理解SDK的结构。

* [HTML在线浏览](http://oiy037d6a.bkt.clouddn.com/csharp-sdk-ref-v7.2.6/index.html)
* [HTML在线浏览](http://oiy037d6a.bkt.clouddn.com/csharp-sdk-ref-v7.2.7/index.html)

* [CHM文件下载](http://oiy037d6a.bkt.clouddn.com/QiniuCSharpSDK-Ref-v7.2.6.chm)
* [CHM文件下载](http://oiy037d6a.bkt.clouddn.com/QiniuCSharpSDK-Ref-v7.2.7.chm)

以下文档/链接提供一些基本示例,参考这些示例可以帮助您更快熟悉如何使用这套SDK。

* [github | csharp-sdk-examples](https://github.com/fengyhack/csharp-sdk-examples)

* [C# SDK使用指南 | 代码示例](http://oiy037d6a.bkt.clouddn.com/csharp-sdk-man-v7.2.6/index.html)
* [C# SDK使用指南 | 代码示例](http://oiy037d6a.bkt.clouddn.com/csharp-sdk-man-v7.2.7/index.html)

##如何安装

Expand Down Expand Up @@ -61,14 +61,16 @@ git clone https://github.com/qiniu/csharp-sdk
| .NET Framework 4.0 | Qiniu.Net40.sln |
| .NET Framework 4.5 | Qiniu.Net45.sln |
| .NET Framework 4.6 | Qiniu.Net46.sln |
| .NET Core(netstandard1.6) | Qiniu.NetStandard16.sln |
| .NET Core | Qiniu.Core.sln |
| Win10 UWP| Qiniu.UWP.sln |
| 以上全部 | Qiniu.ALL_VER.sln |

**注意**

如需编译`Qiniu.NetStandard16`或者`Qiniu.ALL_VER`(它包含前者),请先将`project.json``project.lock.json`拷贝至`Qiniu`文件夹下,或者拷贝`project.json`文件然后执行`dotnet restore`命令(推荐)。
如需编译`Qiniu.Core.sln`(或`Qiniu.UWP.sln`),请先将`Qiniu.NetCore`(或`Qiniu.UWP`)文件夹下的
`project.json``project.lock.json`拷贝至`Qiniu`文件夹下,或者只拷贝`project.json`文件然后执行`dotnet restore`命令(推荐)。

如需编译其他非NetCore版本,请删除`Qiniu`文件夹下的`project.json``project.lock.json`(如果有)
编译其他版本时,如果`Qiniu`文件夹下有`project.json``project.lock.json`,请先删除

##API参考手册

Expand Down Expand Up @@ -209,3 +211,28 @@ dotnet Example.dll
当然,执行这个命令之前,`dotnet`工具是必须安装的。

如果您发布到Windows并且生成了exe文件,直接双击就可以运行。

###速览Win10 UWP

Win10 UWP是指“Windows 10 通用应用”,它和之前的.NET应用开发有一些区别,比如文件存储使用的是StorageFolder和StorageFile等。具体请参阅Windows官方文档。

同样的,UWP解决方案中也包含一个project.json文件,以下是一个简单的示例:

```json
{
"dependencies": {
"Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0"
},
"frameworks": {
"uap10.0": {}
},
"runtimes": {
"win10-arm": {},
"win10-arm-aot": {},
"win10-x86": {},
"win10-x86-aot": {},
"win10-x64": {},
"win10-x64-aot": {}
}
}
```
Binary file removed bin/qiniu-csharp-sdk-v7.2.6.zip
Binary file not shown.
Binary file added bin/qiniu-csharp-sdk-v7.2.7.zip
Binary file not shown.

0 comments on commit 98a64c7

Please sign in to comment.