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

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

DownloadStringCompletedEventHandler デリゲートを作成する場合は、イベントを処理するメソッドを識別してください。イベントをイベント ハンドラに関連付けるには、デリゲートのインスタンスをイベントに追加します。デリゲートを削除しない限り、そのイベントが発生すると常にイベント ハンドラが呼び出されます。イベント ハンドラ デリゲートの詳細については、「イベントとデリゲート」を参照してください。

' Sample call : DownloadStringInBackground2 ("http:' www.contoso.com/GameScores.html") Public Shared Sub DownloadStringInBackground2(ByVal address As String) Dim client As WebClient = New WebClient() ' Specify that the DownloadStringCallback2 method gets called ' when the download completes. AddHandler client.DownloadStringCompleted, AddressOf DownloadStringCallback2 Dim uri as Uri = New Uri(address) client.DownloadStringAsync(uri) End Sub
// Sample call : DownloadStringInBackground2 ("http://www.contoso.com/GameScores.html"); public static void DownloadStringInBackground2 (string address) { WebClient client = new WebClient (); Uri uri = new Uri(address); // Specify that the DownloadStringCallback2 method gets called // when the download completes. client.DownloadStringCompleted += new DownloadStringCompletedEventHandler (DownloadStringCallback2); client.DownloadStringAsync (uri); }
Public Shared Sub DownloadStringCallback2(ByVal sender As Object, ByVal e As DownloadStringCompletedEventArgs) ' If the request was not canceled and did not throw ' an exception, display the resource. If e.Cancelled = False AndAlso e.Error Is Nothing Then Dim textString As String = CStr(e.Result) Console.WriteLine(textString) End If End Sub
public static void DownloadStringCallback2 (Object sender, DownloadStringCompletedEventArgs e) { // If the request was not canceled and did not throw // an exception, display the resource. if (!e.Cancelled && e.Error == null) { string textString = (string)e.Result; Console.WriteLine (textString); } }

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に収録されているすべての辞書からDownloadStringCompletedEventHandler デリゲートを検索する場合は、下記のリンクをクリックしてください。

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