Skip to content

Commit 32e12df

Browse files
committed
Merge pull request #5 from why404/master
updated sdk download link
2 parents c28731f + cf9d999 commit 32e12df

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Docs/README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
---
2+
title: C# SDK | 七牛云存储
3+
---
4+
25
# C# SDK 使用指南
36

47

58
此 SDK 适用于 .NET4 及以上版本。
69

7-
SDK下载地址:[https://github.com/qiniu/csharp-sdk](https://github.com/qiniu/csharp-sdk)
10+
SDK下载地址:[https://github.com/qiniu/csharp-sdk/tags](https://github.com/qiniu/csharp-sdk/tags)
811

912

1013
**应用接入**
@@ -62,10 +65,10 @@ SDK下载地址:[https://github.com/qiniu/csharp-sdk](https://github.com/qiniu
6265

6366
// 首先定义资源表名
6467
string tableName = "tableName";
65-
68+
6669
// 然后获得签名认证
6770
DigestAuthClient conn = new DigestAuthClient();
68-
71+
6972
// 签名认证完成后,即可使用该认证来新建资源表
7073
RSService rs = new RSService(conn, tableName);
7174

@@ -94,25 +97,25 @@ SDK下载地址:[https://github.com/qiniu/csharp-sdk](https://github.com/qiniu
9497

9598
// 调用资源表对象的 PutFile() 方法进行文件上传
9699
PutFileRet putFileRet = rs.PutFile(key, mimeType, filePath, customMeta);
97-
100+
98101
##### 2. 客户端上传
99-
102+
100103
因为服务器端已经在之前进行过签名认证持有相应的安全凭证,因此可以直接进行上传。而由于客户端并不持有对RS的安全凭证,所以需要获取上传授权,从而得到一个有上传权限的URL,参见[获得上传授权](#rs-PutAuth)。在获得上传授权URL后,就可以开始上传文件了,示例代码如下:
101104

102105
// 在客户端上传文件之前,需要获得上传授权,得到经过授权的临时URL
103106
PutAuthRet putAuthRet = rs.PutAuth();
104107
uploadUrl = putAuthRet.Url;
105-
108+
106109
// 通过该临时 URL 进行文件上传
107-
PutFileRet putFileRet = RSClient.PutFile(uploadUrl, tableName, key, mimeType,
110+
PutFileRet putFileRet = RSClient.PutFile(uploadUrl, tableName, key, mimeType,
108111
filePath, customMeta, callbackParam);
109112

110113
<a name="rs-Stat"></a>
111114

112115
### 4. 获取已上传文件信息
113116

114117
您可以调用资源表对象的 Stat() 方法并传入一个 Key 来获取指定文件的相关信息。
115-
118+
116119
// 获取资源表中特定文件信息
117120
StatRet statRet = rs.Stat(key);
118121

0 commit comments

Comments
 (0)