Amazon AWS SDK Uživatelská příručka Strana 23

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 73
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 22
No Callback Specified
The following example code calls BeginPutObject, performs some work, then calls EndPutObject to
retrieve the service response.The call to EndPutObject is enclosed in a try block to catch any exceptions
that might have been thrown during the operation.
asyncResult = client.BeginPutObject(request, null, null);
while ( ! asyncResult.IsCompleted ) {
//
// Do some work here
//
}
try {
response = client.EndPutObject(asyncResult);
}
catch (AmazonS3Exception s3Exception) {
//
// Code to process exception
//
}
Simple Callback
This example assumes that the following callback function has been defined.
public static void SimpleCallback(IAsyncResult asyncResult)
{
Console.WriteLine("Finished PutObject operation with simple callback");
}
The following line of code calls BeginPutObject and specifies the above callback function. When the
PutObject operation completes, the callback function is called. The call to BeginPutObject specifies
null for the state parameter because the simple callback function does not access the AsyncState
property of the asyncResult parameter. Neither the calling code or the callback function call EndPutO-
bject.Therefore, the service response is effectively discarded and any exceptions that occur during the
operation are ignored.
asyncResult = client.BeginPutObject(request, SimpleCallback, null);
Callback with Client
This example assumes that the following callback function has been defined.
public static void CallbackWithClient(IAsyncResult asyncResult)
{
try {
AmazonS3Client s3Client = (AmazonS3Client) asyncResult.AsyncState;
PutObjectResponse response = s3Client.EndPutObject(asyncResult);
Console.WriteLine("Finished PutObject operation with client callback");
}
catch (AmazonS3Exception s3Exception) {
//
// Code to process exception
//
Version v2.0.0
19
AWS SDK for .NET Developer Guide
Asynchronous API for .NET 3.5
Zobrazit stránku 22
1 2 ... 18 19 20 21 22 23 24 25 26 27 28 ... 72 73

Komentáře k této Příručce

Žádné komentáře

Electrolux UFFLEXA podręczniki

Instrukcje obsługi i podręczniki użytkownika dla Odkurzacze Electrolux UFFLEXA.
Dostarczamy 2 pdf podręczników Electrolux UFFLEXA do pobrania za darmo według typów dokumentów: Instrukcja Użytkownika






Więcej produktów i instrukcji dla Odkurzacze Electrolux

Modele Rodzaj dokumentu
Z 2305 Instrukcja Użytkownika   Electrolux Z 2305 User Manual, 10 strony
Z4520T Instrukcja Użytkownika   Electrolux Z4520T User Manual, 5 strony
ZSPCSILENT Instrukcja Użytkownika       Electrolux ZSPCPARKET دليل الاستخدام [en] , 16 strony
UFORIGIN Instrukcja Użytkownika      Electrolux UFORIGIN دليل الاستخدام [en] , 92 strony
ZUSG4062 Instrukcja Użytkownika    Electrolux ZUSG4062 用户手册 [nl] , 36 strony
ZB3105 Instrukcja Użytkownika   Electrolux ZB3214G دليل الاستخدام, 28 strony
ZUS3960 Instrukcja Użytkownika     Electrolux ZUS3940P 用户手册, 56 strony
UMORIGIN Instrukcja Użytkownika        Electrolux UMORIGIN Korisnički priručnik [sv] , 76 strony
ZE340B Instrukcja Użytkownika       Electrolux ZE311G Ръководство за употреба, 6 strony
EL3000A Instrukcja Użytkownika     Electrolux EL3000A User Manual, 24 strony
ZUP3815 Instrukcja Użytkownika     Electrolux ZUP3815 Brugermanual, 92 strony
ZUA3840 Instrukcja Użytkownika     Electrolux ZUA3840 Brugermanual [en] , 92 strony
ZB5012 Instrukcja Użytkownika    Electrolux ZB5012 Ръководство за употреба [sv] , 108 strony
ZUSG3901 Instrukcja Użytkownika     Electrolux ZUSG3901 用户手册, 60 strony
ZUP3860CA Instrukcja Użytkownika     Electrolux ZUP3820RT Brugermanual, 92 strony
APORIGIN Instrukcja Użytkownika       Electrolux APORIGIN Ръководство за употреба, 72 strony
ZUSG3901 Instrukcja Użytkownika       Electrolux ZUSG3901 Brugermanual, 96 strony
ZAPORIGINE Instrukcja Użytkownika       Electrolux ZAPORIGINW دليل الاستخدام [es] [pt] , 72 strony
EUS8X2DB Instrukcja Użytkownika      Electrolux EUS8X3CB دليل الاستخدام, 96 strony
ZB3005 Instrukcja Użytkownika       Electrolux ZB3005 Ръководство за употреба, 84 strony