SmtpClient.OnSendCompleted(AsyncCompletedEventArgs) 方法

定义

引发 SendCompleted 事件。

protected:
 void OnSendCompleted(System::ComponentModel::AsyncCompletedEventArgs ^ e);
protected void OnSendCompleted (System.ComponentModel.AsyncCompletedEventArgs e);
member this.OnSendCompleted : System.ComponentModel.AsyncCompletedEventArgs -> unit
Protected Sub OnSendCompleted (e As AsyncCompletedEventArgs)

参数

注解

SmtpClient 类继承的类可以重写 方法, OnSendCompleted 以在事件发生时 SendCompleted 执行其他任务。

OnSendCompleted 还允许派生类在不附加委托的情况下处理 SendCompleted 。 这是在派生类中处理 SendCompleted 的首选方法。

继承者说明

在派生类中重写 OnSendCompleted(AsyncCompletedEventArgs) 时,请务必调用基类的 OnSendCompleted(AsyncCompletedEventArgs) 方法,以便注册的委托接收 SendCompleted 事件。

适用于