百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

dropbox-sdk-dotnet

> 编程语言
开源

官方 Dropbox API V2 SDK 为.NET

347 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

官方 Dropbox API V2 SDK 为.NET

Important: Use v7.0.0 or newer of this SDK for compatibility with the Dropbox API servers. Older versions stopped working in January 2026. Please refer to this blog post for more information: https://dropbox.tech/developers/api-server-certificate-changes

Logo The official Dropbox SDK for DotNet.

Documentation can be found on GitHub Pages

Installation

Create an app via the Developer Console

Install via NuGet

PM> Install-Package Dropbox.Api

After installation, follow one of our Examples or read the Documentation.

You can also view our OAuth guide.

Examples

We provide Examples to help get you started with a lot of the basic functionality in the SDK.

  • OAuth
    • OAuth Basic - Simple application that runs through a basic OAuth flow to acquire a token and make a call to users/get_current_account.
    • OAuth PKCE - Simple application that runs through an OAuth flow using PKCE and acquires a token to make a call to users/get_current_account.
  • Other Examples
    • Simple Test - This is a simple test which validates some simple functionality (This is a good place to start to see how the SDK can be used)
    • Simple Blog Demo - This is a simple demo of how the Dropbox SDK can be used to create a simple blog with backed up blog posts
    • Simple Business Dashboard - This is a demo of a business dashboard
    • Universal Demo - This is an example of how to use the SDK across multiple platforms

Upload integrity

For file upload calls whose request type includes ContentHash, the SDK automatically computes and sends a Dropbox content_hash when the upload stream is seekable. The server rejects the upload if the hash does not match the bytes it receives.

Because content_hash is part of the request header, this default-on validation reads the stream once to compute the hash, seeks back to the original position, and then reads it again for the upload body. That is two reads (2×) of I/O for seekable uploads. For local files the second read is often served from OS cache; for slow, network-backed, or encrypted streams it can materially increase upload time. Non-seekable streams are uploaded without automatic hashing. A manually supplied contentHash argument always wins. If a seekable stream has unusual read or rewind behavior, disable automatic hashing for that upload or client.

You can also compute a content hash yourself, for example to verify a downloaded file against its ContentHash metadata:

csharp
using Dropbox.Api.Files;

using (var stream = File.OpenRead("local-file.txt"))
{
    var contentHash = ContentHasher.ComputeHash(stream);
    // Compare against metadata.ContentHash returned by the server.
}

To disable automatic hashing for one upload, wrap the stream:

csharp
using Dropbox.Api.Files;

await client.Files.UploadAsync(
    new UploadArg("/remote-file.txt"),
    ContentHasher.WithoutAutoContentHash(stream));

To disable automatic hashing for a client:

csharp
var config = new DropboxClientConfig
{
    AutoContentHash = false,
};

Getting Help

If you find a bug, please see CONTRIBUTING.md for information on how to report it.

If you need help that is not specific to this SDK, please reach out to Dropbox Support.

License

This SDK is distributed under the MIT license, please see LICENSE for more information.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#dotnetdropboxdropbox-apidropbox-sdk

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言