如何:获取当前的应用程序对象

更新:2007 年 11 月

此示例演示如何为当前的 AppDomain 获取对 Application 对象实例的引用。

示例

下面的示例演示如何从 Current 属性获取对当前 Application 对象实例的引用。

// Get a reference to the current Application object
Application currentApplication = Application.Current;