OpenWriteCompletedEventArgs クラス
アセンブリ: System (system.dll 内)



ストリームを開いてアップロード対象のデータを書き込むコード例を次に示します。
Public Shared Sub OpenResourceForPosting(ByVal address As String) Dim client As WebClient = New WebClient() ' Specify that the OpenWriteCallback method gets called ' when the writeable stream is available. AddHandler client.OpenWriteCompleted, AddressOf OpenWriteCallback2 Dim uri as Uri = New Uri(address) client.OpenWriteAsync(uri) ' Applications can perform other tasks ' while waiting for the upload to complete. End Sub
public static void OpenResourceForPosting (string address) { WebClient client = new WebClient (); Uri uri = new Uri(address); // Specify that the OpenWriteCallback method gets called // when the writeable stream is available. client.OpenWriteCompleted += new OpenWriteCompletedEventHandler (OpenWriteCallback2); client.OpenWriteAsync (uri); // Applications can perform other tasks // while waiting for the upload to complete. }
Public Shared Sub OpenWriteCallback2(ByVal sender As Object, ByVal e As OpenWriteCompletedEventArgs) Dim body As Stream = Nothing Dim s As StreamWriter = Nothing Try body = CType(e.Result, Stream) s = New StreamWriter(body) s.AutoFlush = True s.Write("This is content data to be sent to the server.") Finally If Not s Is Nothing Then s.Close() End If If Not body Is Nothing Then body.Close() End If End Try End Sub
public static void OpenWriteCallback2 (Object sender, OpenWriteCompletedEventArgs e) { Stream body = null; StreamWriter s = null; try { body = (Stream)e.Result; s = new StreamWriter (body); s.AutoFlush = true; s.Write ("This is content data to be sent to the server."); } finally { if (s != null) { s.Close (); } if (body != null) { body.Close (); } } }

System.EventArgs
System.ComponentModel.AsyncCompletedEventArgs
System.Net.OpenWriteCompletedEventArgs


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


OpenWriteCompletedEventArgs プロパティ

名前 | 説明 | |
---|---|---|
![]() | Cancelled | 非同期操作がキャンセルされたかどうかを示す値を取得します。 ( AsyncCompletedEventArgs から継承されます。) |
![]() | Error | 非同期操作中に発生したエラーを示す値を取得します。 ( AsyncCompletedEventArgs から継承されます。) |
![]() | Result | データをサーバーに送信するために使用される書き込み可能なストリームを取得します。 |
![]() | UserState | 非同期タスクの一意の識別子を取得します。 ( AsyncCompletedEventArgs から継承されます。) |

OpenWriteCompletedEventArgs メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
![]() | RaiseExceptionIfNecessary | 非同期操作が失敗した場合は、ユーザー指定の例外を発生させます。 ( AsyncCompletedEventArgs から継承されます。) |

OpenWriteCompletedEventArgs メンバ
OpenWriteCompleted イベントのデータを提供します。
OpenWriteCompletedEventArgs データ型で公開されるメンバを以下の表に示します。

名前 | 説明 | |
---|---|---|
![]() | Cancelled | 非同期操作がキャンセルされたかどうかを示す値を取得します。(AsyncCompletedEventArgs から継承されます。) |
![]() | Error | 非同期操作中に発生したエラーを示す値を取得します。(AsyncCompletedEventArgs から継承されます。) |
![]() | Result | データをサーバーに送信するために使用される書き込み可能なストリームを取得します。 |
![]() | UserState | 非同期タスクの一意の識別子を取得します。(AsyncCompletedEventArgs から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
![]() | RaiseExceptionIfNecessary | 非同期操作が失敗した場合は、ユーザー指定の例外を発生させます。 (AsyncCompletedEventArgs から継承されます。) |

- OpenWriteCompletedEventArgsのページへのリンク