WebClient.DownloadDataCompleted イベント
アセンブリ: System (system.dll 内)

Dim instance As WebClient Dim handler As DownloadDataCompletedEventHandler AddHandler instance.DownloadDataCompleted, handler
public: event DownloadDataCompletedEventHandler^ DownloadDataCompleted { void add (DownloadDataCompletedEventHandler^ value); void remove (DownloadDataCompletedEventHandler^ value); }

このイベントは、非同期のデータ ダウンロード操作が完了するたびに発生します。非同期のデータ ダウンロードは、DownloadDataAsync メソッドを呼び出すことによって開始されます。
DownloadDataCompletedEventHandler は、このイベントのデリゲートです。DownloadDataCompletedEventArgs クラスは、イベント ハンドラにイベント データを提供します。

このイベントのイベント ハンドラを設定するコード例を次に示します。
' Sample call : DownLoadDataInBackground ("http:' www.contoso.com/GameScores.html") Public Shared Sub DownloadDataInBackground(ByVal address As String) Dim waiter As System.Threading.AutoResetEvent = New System.Threading.AutoResetEvent(False) Dim client As WebClient = New WebClient() ' Specify that the DownloadDataCallback method gets called ' when the download completes. AddHandler client.DownloadDataCompleted, AddressOf DownloadDataCallback Dim uri as Uri = New Uri(address) client.DownloadDataAsync(uri, waiter) ' Block the main application thread. Real applications ' can perform other tasks while waiting for the download to complete. waiter.WaitOne() End Sub
// Sample call : DownLoadDataInBackground ("http://www.contoso.com/GameScores.html"); public static void DownloadDataInBackground (string address) { System.Threading.AutoResetEvent waiter = new System.Threading.AutoResetEvent (false); WebClient client = new WebClient (); Uri uri = new Uri(address); // Specify that the DownloadDataCallback method gets called // when the download completes. client.DownloadDataCompleted += new DownloadDataCompletedEventHandler (DownloadDataCallback); client.DownloadDataAsync (uri, waiter); // Block the main application thread. Real applications // can perform other tasks while waiting for the download to complete. waiter.WaitOne (); }

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からWebClient.DownloadDataCompleted イベントを検索する場合は、下記のリンクをクリックしてください。

- WebClient.DownloadDataCompleted イベントのページへのリンク