Installer.AfterUninstall 事件
在 Installers 属性中所有安装程序都执行它们的卸载操作后发生。
**命名空间:**System.Configuration.Install
**程序集:**System.Configuration.Install(在 system.configuration.install.dll 中)
语法
声明
Public Event AfterUninstall As InstallEventHandler
用法
Dim instance As Installer
Dim handler As InstallEventHandler
AddHandler instance.AfterUninstall, handler
public event InstallEventHandler AfterUninstall
public:
event InstallEventHandler^ AfterUninstall {
void add (InstallEventHandler^ value);
void remove (InstallEventHandler^ value);
}
/** @event */
public void add_AfterUninstall (InstallEventHandler value)
/** @event */
public void remove_AfterUninstall (InstallEventHandler value)
JScript 支持使用事件,但不支持进行新的声明。
示例
下面的示例说明 AfterUninstall 事件。它由 OnAfterUninstall 方法引发。
' MyInstaller is derived from the class 'Installer'.
Sub New()
MyBase.New()
AddHandler AfterUninstall, AddressOf AfterUninstallEventHandler
End Sub 'New
Private Sub AfterUninstallEventHandler(sender As Object, e As InstallEventArgs)
' Add steps to perform any actions before the Uninstall process.
Console.WriteLine("Code for AfterUninstallEventHandler")
End Sub 'AfterUninstallEventHandler
// MyInstaller is derived from the class 'Installer'.
MyInstaller() : base()
{
AfterUninstall += new InstallEventHandler(AfterUninstallEventHandler);
}
private void AfterUninstallEventHandler(object sender, InstallEventArgs e)
{
// Add steps to perform any actions before the Uninstall process.
Console.WriteLine("Code for AfterUninstallEventHandler");
}
// MyInstaller is derived from the class 'Installer'.
private:
MyInstaller()
{
AfterUninstall += gcnew InstallEventHandler( this, &MyInstaller::AfterUninstallEventHandler );
}
void AfterUninstallEventHandler( Object^ sender, InstallEventArgs^ e )
{
// Add steps to perform any actions before the Uninstall process.
Console::WriteLine( "Code for AfterUninstallEventHandler" );
}
// MyInstaller is derived from the class 'Installer'.
MyInstaller()
{
this.add_AfterUninstall(
new InstallEventHandler(AfterUninstallEventHandler));
} //MyInstaller
private void AfterUninstallEventHandler(Object sender, InstallEventArgs e)
{
// Add steps to perform any actions before the Uninstall process.
Console.WriteLine("Code for AfterUninstallEventHandler");
} //AfterUninstallEventHandler
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见。
平台
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 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
版本信息
.NET Framework
受以下版本支持:2.0、1.1、1.0
请参见
参考
Installer 类
Installer 成员
System.Configuration.Install 命名空间
BeforeUninstall
OnAfterUninstall
OnBeforeUninstall