您的位置:首页 > 其它

.Net与WMI—1(Using the System.Management Namespace)

2008-09-07 11:14 302 查看

Chapter 2: Using the System.Management Namespace

Overview

Driven by the desire to make the bulk of WMI system management functions easily accessible to .NET developers, the designers of the System.Management namespace built quite a few powerful types that expose all but the most obscure aspects of WMI functionality. Housing more than 40 different classes, this namespace may look complex or even intimidating to a beginner or a casual observer. This seeming complexity, however, is just an illusion; in fact, most of the System.Management types are remarkably easy to use thanks to a well-defined structure and a well-thought-out design. I'm sure that once you spend some time programming .NET management applications, you will quickly overcome any initial confusion and grow to appreciate the elegance and straightforwardness of the System.Management object model.

为了使.NET开发人员方便的的访问WMI系统管理函数,设计者在System.Management空间中建立了一些十分强大的类型来对应WMI中的函数。这个空间里有超过40个不同的类,这些类看起来很复杂以至于让初学者或偶遇者感到恐惧。看起来很复杂,但是,这只是幻觉。事实上,大多数的System.Management类型都很容易使用,这得益于它结构上的明确定义和设计上的深思熟虑。我确信一旦你花费一定的时间设计.NET管理程序,你将很快的克服掉先前的困惑慢慢的开始欣赏System.Management对象模型的优美和易懂。

The first thing that will help you to take the veil of complexity off the System.Management namespace is understanding that most of its types are auxiliary—they do not, by themselves, represent logical abstractions of WMI functionality. In fact, you will soon find yourself spending most of your time with two of the System.Management types: ManagementObject and ManagementClass . These two types reflect WMI objects and schema elements respectively. The rest of the types, although they are very useful and even indispensable at times, are just used to either obtain certain instances of the ManagementObject and ManagementClass types, or affect the behavior of these two types.

帮助你解开System.Management命名空间面纱的第一步是要明白这个空间的大多数类型都是辅助性的,它们自己描绘了WMI函数的逻辑抽象。事实上,你不久就会发现你花费的大部分时间是在System.Management空间里的ManagementObject和ManagementClass这两个类上。这两个类反映了WMI的各个对象模型元素。剩下的类型,虽然他们也非常有用甚至有时候必不可少,也都只是用来获得ManagementObjec和ManagementClass的实例或影响这两个类。

Since this chapter zeroes in on the methods and properties of ManagementObject and ManagementClass types, you may want to focus on the material presented here to understand the core of System.Management functionality and to become proficient at programming the management applications. While certain more complex or more specialized aspects of WMI programming are covered in subsequent chapters, the most fundamental concepts, such as navigating the CIM, reading and updating the management data, and analyzing the WMI schema, are presented here. In fact, the contents of this chapter alone should equip you with the skills necessary to build moderately
complex system management tools.

这章是介绍ManagementObject和ManagementClass的方法和属性,你可能想集中了解System.Management函数的内在的东西从而写出专业的管理程序。当然,在后面的章节包含的有设计专业的复杂的WMI程序。在这章是些基础的概念如导航CIM,读取更新数据,分析WMI模型。事实上,这章的内容会帮助你获得设计复杂的程序的必备技能。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐