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

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

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

このイベントのイベント ハンドラを設定するコード例を次に示します。
' Sample call : DownLoadFileInBackground2 ("http:' www.contoso.com/logs/January.txt") Public Shared Sub DownLoadFileInBackground2(ByVal address As String) Dim client As WebClient = New WebClient() ' Specify that the DownloadFileCallback method gets called ' when the download completes. AddHandler client.DownloadFileCompleted, AddressOf DownloadFileCallback2 ' Specify a progress notification handler. AddHandler client.DownloadProgressChanged, AddressOf DownloadProgressCallback Dim uri as Uri = New Uri(address) client.DownloadFileAsync(uri, "serverdata.txt") End Sub
// Sample call : DownLoadFileInBackground2 ("http://www.contoso.com/logs/January.txt"); public static void DownLoadFileInBackground2 (string address) { WebClient client = new WebClient (); Uri uri = new Uri(address); // Specify that the DownloadFileCallback method gets called // when the download completes. client.DownloadFileCompleted += new AsyncCompletedEventHandler (DownloadFileCallback2); // Specify a progress notification handler. client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressCallback); client.DownloadFileAsync (uri, "serverdata.txt"); }

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.DownloadFileCompleted イベントを検索する場合は、下記のリンクをクリックしてください。

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