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)

参数

e
AsyncCompletedEventArgs

包含事件数据的一个 AsyncCompletedEventArgs

注解

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

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

继承者说明

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

适用于