

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 的 Amazon S3 程式碼範例 適用於 C\+\+ 的 AWS SDK
<a name="examples-s3"></a>

[Amazon S3](https://aws.amazon.com/s3) 是物件儲存體，用於從任何地方存放和擷取任意數量的資料。提供多個類別 適用於 C\+\+ 的 AWS SDK 以與 Amazon S3 連接。

**注意**  
本指南僅提供示範特定技術所需的程式碼，但[完整的範例程式碼可在 GitHub 上取得](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/cpp)。在 GitHub 上，您可以下載單一來源檔案，也可以在本機複製儲存庫，以取得、建置和執行所有範例。
+ [https://docs.aws.amazon.com/sdk-for-cpp/latest/api/aws-cpp-sdk-s3/html/class_aws_1_1_s3_1_1_s3_client.html](https://docs.aws.amazon.com/sdk-for-cpp/latest/api/aws-cpp-sdk-s3/html/class_aws_1_1_s3_1_1_s3_client.html) 類別 

  `S3Client` 程式庫是功能完整的 Amazon S3 介面。

  此集中`list_buckets_disabling_dns_cache.cpp`的範例專為在 Linux/Mac 上使用 CURL 而設計 （雖然可以修改為在 Windows 上使用）。如果您在 Windows 上，請在建置專案`list_buckets_disabling_dns_cache.cpp`之前刪除 檔案，因為它依賴 Linux 的 curl HttpClient。

  使用 的範例程式碼`S3Client`位於 Github 的 [`s3` 資料夾中](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/cpp/example_code/s3)。如需此範例集示範的完整函數清單，請參閱 Github 上的[讀我](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/cpp/example_code/s3/README.md)檔案。

  本指南中會詳細說明`s3`範例集的部分：
  + [建立、列出和刪除儲存貯體](examples-s3-buckets.md)
  + [可對物件執行的操作](examples-s3-objects.md) – 上傳和下載資料物件
  + [管理 Amazon S3 存取許可](examples-s3-access-permissions.md)
  + [使用儲存貯體政策管理對 Amazon S3 儲存貯體的存取](examples-s3-bucket-policies.md)
  + [將 Amazon S3 儲存貯體設定為網站](examples-s3-website-configuration.md)
+ [https://docs.aws.amazon.com/sdk-for-cpp/latest/api/aws-cpp-sdk-s3-crt/html/class_aws_1_1_s3_crt_1_1_s3_crt_client.html](https://docs.aws.amazon.com/sdk-for-cpp/latest/api/aws-cpp-sdk-s3-crt/html/class_aws_1_1_s3_crt_1_1_s3_crt_client.html) 類別 

  `S3CrtClient` 已在 SDK 的 1.9 版中新增 。 為 Amazon S3 GET （下載） 和 PUT （上傳） 操作`S3CrtClient`提供高輸送量。在 AWS 通用執行期 (CRT) 程式庫的頂端`S3CrtClient`實作 。

  使用 的範例程式碼`S3CrtClient`位於 Github 的 [`s3-crt` 資料夾中](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/cpp/example_code/s3-crt)。如需此範例集示範的完整函數清單，請參閱 Github 上的[讀我](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/cpp/example_code/s3-crt/README.md)檔案。
  + [使用 `S3CrtClient`進行 Amazon S3 操作](examples-s3-crt.md)
+ [https://docs.aws.amazon.com/sdk-for-cpp/latest/api/aws-cpp-sdk-transfer/html/class_aws_1_1_transfer_1_1_transfer_manager.html](https://docs.aws.amazon.com/sdk-for-cpp/latest/api/aws-cpp-sdk-transfer/html/class_aws_1_1_transfer_1_1_transfer_manager.html) 類別 

  `TransferManager` 是一種全受管服務，可透過檔案傳輸協定 (FTP)、透過 SSL 的檔案傳輸協定 (FTPS) 或 Secure Shell (SSH) 檔案傳輸協定 (SFTP) 直接傳入和傳出 Amazon S3。

  使用 的範例程式碼`TransferManager`位於 Github 的 [`transfer-manager` 資料夾中](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/cpp/example_code/transfer-manager)。如需此範例集示範的完整函數清單，請參閱 Github 上的[讀我](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/cpp/example_code/transfer-manager/README.md)檔案。
  + [將 TransferManager 用於 Amazon S3 操作](examples-s3-transfermanager.md)