DownloadProgressChangedEventHandler デリゲート
アセンブリ: System (system.dll 内)

Public Delegate Sub DownloadProgressChangedEventHandler ( _ sender As Object, _ e As DownloadProgressChangedEventArgs _ )
public delegate void DownloadProgressChangedEventHandler ( Object sender, DownloadProgressChangedEventArgs e )
public delegate void DownloadProgressChangedEventHandler ( Object^ sender, DownloadProgressChangedEventArgs^ e )
/** @delegate */ public delegate void DownloadProgressChangedEventHandler ( Object sender, DownloadProgressChangedEventArgs e )

DownloadProgressChangedEventHandler デリゲートを作成する場合は、イベントを処理するメソッドを識別してください。イベントをイベント ハンドラに関連付けるには、デリゲートのインスタンスをイベントに追加します。デリゲートを削除しない限り、そのイベントが発生すると常にイベント ハンドラが呼び出されます。イベント ハンドラ デリゲートの詳細については、「イベントとデリゲート」を参照してください。 イベントとデリゲート
![]() |
---|
ダウンロードされるファイルのサイズをサーバーが送信しない場合 (パッシブ FTP 接続の場合など) は、ProgressPercentage が常に 0 になることがあります。 |

WebClient.DownloadProgressChanged イベントのイベント ハンドラを設定するコード例を次に示します。
' 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に収録されているすべての辞書からDownloadProgressChangedEventHandler デリゲートを検索する場合は、下記のリンクをクリックしてください。

- DownloadProgressChangedEventHandler デリゲートのページへのリンク