WMI005-WMI学习笔记(五)——Using WMI with the .NET Framework(.NET框架使用WMI)

来源:互联网 发布:百人牛牛作弊辅助软件 编辑:程序博客网 时间:2024/05/29 19:56

原文地址链接:http://msdn.microsoft.com/en-us/library/aa310909(v=vs.71).aspx

Using WMI with the .NET Framework

.NET Framework 1.1

WMI provides extensive instrumentation to accomplish almost any management task for many high-end applications (for example, Microsoft Exchange, Microsoft SQL Server, and Microsoft Internet Information Services (IIS)). An administrator can perform the following tasks:

WMI提供了大量的用于完成几乎所有的管理任务的操作。

用于“高端的应用程序”(例如Microsoft Exchange, Microsoft SQL Server, and Microsoft Internet Information Services (IIS)).

管理与可以操作以下任务。

  • Monitor the health of the applications.
  • 监视应用程序的健康状态。
  • Detect bottlenecks or failures.
  • 检测瓶颈和失败。
  • Manage and configure applications.
  • 管理和配置应用程序。
  • Query application data (use the traversal and querying of object relationships).
  • 查询应用程序数据。
  • Perform seamless local or remote management operations.
  • 无缝的执行本地和远程的管理操作。

The WMI architecture consists of the following three tiers:

WMI体系结构包括以下三层。

  • Clients
  • 客户端

    Software components that perform operations using WMI (for example, reading management details, configuring systems, and subscribing to events).

    使用WMI来执行操作的软件组件。(例如,读取管理详细信息,配置系统,或者捕捉事件等)

  • Object manager
  • 对象管理器

    A broker between providers and clients that provides some key services, such as standard event publication and subscription, event filtering, query engine, and so on.

    客户端和服务器端的中介,提供一些关键服务,比如基本的事件发布和捕捉,事件过滤,查询引擎以及其他等等的内容。

  • Providers
  • 服务器(提供端)

    Software components that capture and return live data to the client applications, process method invocations from the clients, and link the client to the infrastructure being managed.

    获取并返回实时数据给客户端应用程序的软件组件。处理客户端提交的方法,并将客户端链接到管理的基础服务上。

The provision of data and events and the ability to configure systems are provided seamlessly to clients and applications through a well-defined schema. In the .NET Framework, the System.Management namespace provides common classes to traverse the WMI schema.

客户端应用程序无缝地使用提供的数据、事件以及配置系统的能力,是通过一个定义好的模式来进行的。

在.NET框架中,System.Management命名空间提供了基本的类来遍历WMI模式。

(译注:所谓无缝地,既是你只需要获取一个管理对象的查询类实例,然后通过一个SQL语句,然后查询得到一个管理对象类实例,然后便可以通过索引器来索引你需要的内容。你不需要声明各种各样的类实例,仅仅是ManagementObject,你需要的仅仅是在构建ManagementObjectSearch类实例时候用到的SQL语句)

In addition to the .NET Framework, you need to have WMI installed on your computer in order to make use of the management features in this namespace. If you are using Windows Millennium Edition (Windows Me), Windows 2000 or Windows XP, WMI is already installed. Otherwise, you will need to download WMI from MSDN. 

除了安装.NET框架之外,你还需要安装WMI,以便使用System.Management命名空间提供的管理特征。

如果你安装的是Windows ME、2000、XP(以及更高版本),WMI已经安装好了。如果是其他版本,你需要从MSDN下载WMI。

(译注:貌似现在找不到没有安装WMI的Windows系统了)

See Also

Managing Applications Using WMI | Schemas | Queries | Management Events | System.Management and System.Management.Instrumentation Namespaces | Accessing Management Information with System.Management | Instrumenting .NET Framework Applications with System.Management | Browsing the WMI Schema


原创粉丝点击