VB.NET实例教程之查询系统启动信息案例剖析

开发 后端
VB.NET实例教程列举了一个VB.Net查询系统启动信息的实例,有图文解释和代码解释,看了一定会给你带来很大的帮助的。

在网上看到大家对VB.Net调用WMI实现系统管理都很感兴趣,在此呢VB实例教程来教你VB.NET如何调用WMI来实现系统管理和系统信息查询等问题的解决! 赶快看看吧!

VB.Net调用WMI可以实现系统管理和系统信息查询等。WMI全称为Windows Management Instrumentation,利用WMI我们可以实现很多系统管理的功能,msdn在.Net Framework类库中对此描述比较简单(因为早期WMI相关专题有所较详尽描述,故类库中未再详细解说与演示)。

开发环境: VB2005  Windows2003

本实例需要在菜单栏中的“项目”-“ 添加引用” -“ System.Management”并在实例代码中导入引用的项目和程序集中定义的命名空间或编程元素 即: Imports System.Management  

VB.NET实例教程之VB.NET查询系统启动信息的实例

代码如下:

  1. Private Sub Lobdotcn()  
  2. Dim Lob_Searcher As New ManagementObjectSearcher("root\CIMV2", "SELECT * FROM Win32_BootConfiguration")  
  3. For Each Obj_Query As ManagementObject In Lob_Searcher.Get()  
  4. ListBox1.Items.Add("乐博网LOB.Cn   VB.Net爱好者的组织")  
  5. ListBox1.Items.Add("BootDirectory: " & Obj_Query("BootDirectory"))  
  6. ListBox1.Items.Add("Caption: " & Obj_Query("Caption"))  
  7. ListBox1.Items.Add("ConfigurationPath: " & Obj_Query("ConfigurationPath"))  
  8. ListBox1.Items.Add("Description: " & Obj_Query("Description"))  
  9. ListBox1.Items.Add("LastDrive: " & Obj_Query("LastDrive"))  
  10. ListBox1.Items.Add("Name: " & Obj_Query("Name"))  
  11. ListBox1.Items.Add("ScratchDirectory: " & Obj_Query("ScratchDirectory"))  
  12. ListBox1.Items.Add("SettingID: " & Obj_Query("SettingID"))  
  13. ListBox1.Items.Add("TempDirectory: " & Obj_Query("TempDirectory"))  
  14. Next  
  15. End Sub 


相关属性说明:

  1. BootDirectory   
  2. Data type: string  
  3. Access type: Read-only   
  4. Path to the system files required for booting the system.  
  5. Example: "C:\Windows"  
  6. Caption   
  7. Data type: string  
  8. Access type: Read-only  
  9. Qualifiers: MaxLen(64)   
  10. Short description (one-line string) of the CIM_Setting object. This property is inherited from CIM_Setting.  
  11. ConfigurationPath   
  12. Data type: string  
  13. Access type: Read-only   
  14. Path to the configuration files. This value may be similar to the value in the BootDirectory property.  
  15. Description   
  16. Data type: string  
  17. Access type: Read-only   
  18. Description of the CIM_Setting object. This property is inherited from CIM_Setting.  
  19. LastDrive   
  20. Data type: string  
  21. Access type: Read-only   
  22. Last drive letter to which a physical drive is assigned.  
  23. Example: "E:"  
  24. Name   
  25. Data type: string  
  26. Access type: Read-only  
  27. Qualifiers: Key, MaxLen(256)   
  28. Name of the boot configuration. It is an identifier for the boot configuration.  
  29. ScratchDirectory   
  30. Data type: string  
  31. Access type: Read-only   
  32. Directory where temporary files can reside during boot time.  
  33. SettingID   
  34. Data type: string  
  35. Access type: Read-only  
  36. Qualifiers: MaxLen(256)   
  37. Identifier by which the CIM_Setting object is known. This property is inherited from CIM_Setting.  
  38. TempDirectory   
  39. Data type: string  
  40. Access type: Read-only   
  41. Directory where temporary files are stored.  
  42. Example: "C:\TEMP" 

以上就是VB.NET实例教程中VB.NET查询系统启动信息的实例讲解,以后还会对VB.NET很多问题进行讲解,希望即时关注。

【编辑推荐】

  1. 剖析VB.NET平台调用是如何执行操作
  2. 分享个人总结VB.NET多线程
  3. 详细说明VB.NET变量中四点
  4. 三类十二种VB.NET数据类型全面介绍
  5. VB.NET初步知识,初学者必看
责任编辑:田树 来源: 乐博网
相关推荐

2009-10-23 16:27:10

VB.NET实例教程

2009-10-27 15:49:11

VB.NET分辩率

2009-10-28 11:27:34

VB.NET资源文件

2009-07-30 14:18:02

ASP.NET实例教程

2009-10-21 16:00:26

VB.NET CASE

2009-10-23 13:14:38

2009-11-02 16:55:50

VB.NET Smar

2009-10-29 14:02:24

VB和VB.NET比较

2009-10-23 15:35:42

VB.NET实用教程

2009-10-21 17:03:05

VB实例教程

2009-10-27 16:52:41

VB.NET文件传输

2009-10-13 15:09:19

VB.NET使用Tre

2009-11-02 16:22:16

VB.NET面向对象

2009-11-02 15:49:23

VB.NET显示系统信

2009-10-29 11:41:27

VB.NET写Obje

2010-01-12 11:47:09

VB.NET可选参数

2010-01-21 12:55:08

VB.NET对象序列

2009-10-15 17:50:48

VB.NET调用API

2009-10-12 16:51:28

VB.NET使用Ora

2010-01-22 15:37:02

VB.NET监控类
点赞
收藏

51CTO技术栈公众号