User guide
Table Of Contents
- AWS SDK for .NET
- Table of Contents
- AWS SDK for .NET Developer Guide
- Getting Started with the AWS SDK for .NET
- Programming with the AWS SDK for .NET
- AWS SDK for .NET Tutorials and Examples
- Managing ASP.NET Session State with Amazon DynamoDB
- Tutorial: Creating Amazon EC2 Instances with the AWS SDK for .NET
- Tutorial: Grant Access Using an IAM Role and the AWS SDK for .NET
- Tutorial: Amazon EC2 Spot Instances
- Creating and Using an Amazon SQS Queue with the AWS SDK for .NET
- Creating an Amazon Route 53 Hosted Zone and Adding Resource Record Sets
- Additional Resources
- Document History

{
Console.WriteLine("Finished PutObject operation with simple callback");
Console.Write("\n\n");
}
public static void CallbackWithClient(IAsyncResult asyncResult)
{
try {
AmazonS3Client s3Client = (AmazonS3Client) asyncResult.AsyncState;
PutObjectResponse response = s3Client.EndPutObject(asyncResult);
Console.WriteLine("Finished PutObject operation with client call
back");
Console.WriteLine("Service Response:");
Console.WriteLine("-----------------");
Console.WriteLine(response);
Console.Write("\n\n");
}
catch (AmazonS3Exception s3Exception) {
//
// Code to process exception
//
}
}
public static void CallbackWithState(IAsyncResult asyncResult)
{
try {
ClientState state = asyncResult.AsyncState as ClientState;
AmazonS3Client s3Client = (AmazonS3Client)state.Client;
PutObjectResponse response = state.Client.EndPutObject(asyncResult);
Console.WriteLine(
"Finished PutObject operation with state callback that started
at {0}",
(DateTime.Now - state.Start).ToString() + state.Start);
Console.WriteLine("Service Response:");
Console.WriteLine("-----------------");
Console.WriteLine(response);
Console.Write("\n\n");
}
catch (AmazonS3Exception s3Exception) {
//
// Code to process exception
//
}
}
public static void TestPutObjectAsync()
{
// Create a client
AmazonS3Client client = new AmazonS3Client();
PutObjectResponse response;
IAsyncResult asyncResult;
//
Version v2.0.0
22
AWS SDK for .NET Developer Guide
Asynchronous API for .NET 3.5