UpYun.NETCore.SDK
1.0.1
dotnet add package UpYun.NETCore.SDK --version 1.0.1
NuGet\Install-Package UpYun.NETCore.SDK -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="UpYun.NETCore.SDK" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add UpYun.NETCore.SDK --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: UpYun.NETCore.SDK, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install UpYun.NETCore.SDK as a Cake Addin
#addin nuget:?package=UpYun.NETCore.SDK&version=1.0.1
// Install UpYun.NETCore.SDK as a Cake Tool
#tool nuget:?package=UpYun.NETCore.SDK&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
UpYun.NETCore.SDK
又拍云SDK .NET Core版 NuGet安装指令:
Install-Package UpYun.NETCore.SDK
NuGet地址:
支持功能
签名认证,默认Basic认证
文件(图片)上传
上传文件+访问密码+文件MD5验证
上传图片+文字水印
上传图片+图片水印
上传文件+加水印+访问密码+文件MD5验证
创建目录
删除目录
删除文件
读取文件
获取文件信息
获取目录文件列表
获取目录文件列表+分页
获取服务使用量
大文件分块上传
示例代码:
class Program
{
/// <summary>
/// 服务名称
/// </summary>
private static string bucketName = "bucketName";
/// <summary>
/// 操作员账号
/// </summary>
private static string username = "username";
/// <summary>
/// 操作员密码
/// </summary>
private static string password = "password";
/// <summary>
/// 上传文件保存目录
/// </summary>
private static string uploaddir = "uploaddir";
/// <summary>
/// 文件访问密码
/// </summary>
private static string filesecret = "filesecret";
static UpYunConfig fig = new UpYunConfig() { Url = "", IsWebPlossless = true, IsWebPlossy = true, IsHttpResponseMessage = true };
static UpYunClient upyunfig = new UpYunClient(bucketName, username, password, fig);
static void Main(string[] args)
{
WriteFileAsync();
Console.WriteLine("执行结束");
}
/// <summary>
/// 上传文件
/// </summary>
public static void WriteFileAsync()
{
string filepatn = @"C:\upload\20180826212900.png";
string uploadpath = uploaddir.ToFileGuidName(filepatn);
var res = upyunfig.WriteFileAsync(uploadpath, filepatn.ReadFile(), true).Result;
Console.WriteLine(res.Data.ToJson());
}
}
上传文件返回参数:
{
"x-upyun-content-length":[
"46584"
],
"x-upyun-content-type":[
"image/png"
],
"x-upyun-file-type":[
"PNG"
],
"x-upyun-width":[
"218"
],
"x-upyun-height":[
"189"
],
"x-upyun-frames":[
"1"
],
"x-upyun-url":"upyun.xxxxxx.vip/UpYunTest/38281088-2421-4708-87d4-739dc7307859.png",
"x-upyun-webplossless":"upyun.xxxxx.vip/UpYunTest/38281088-2421-4708-87d4-739dc7307859.png!/format/webp/lossless/true",
"x-upyun-webplossy":"upyun.xxxxxxx.vip/UpYunTest/38281088-2421-4708-87d4-739dc7307859.png!/format/webp"
}
更多用法参考UpYun.NETCore.SDK.Test项目
参考:
又拍云REST API:https://docs.upyun.com/api/rest_api/
杨中科:https://github.com/yangzhongke/UpYun.NETCore
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.6.1
- Microsoft.Extensions.DependencyInjection (>= 2.2.0)
- Microsoft.Extensions.Http (>= 2.2.0)
- Newtonsoft.Json (>= 12.0.2)
- NLog.Extensions.Logging (>= 1.5.1)
- System.IO (>= 4.3.0)
-
.NETStandard 2.0
- Microsoft.Extensions.DependencyInjection (>= 2.2.0)
- Microsoft.Extensions.Http (>= 2.2.0)
- Newtonsoft.Json (>= 12.0.2)
- NLog.Extensions.Logging (>= 1.5.1)
- System.IO (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.1 | 591 | 8/14/2019 |
2019-8-14 发布1.0.1