Windows Management Instrumentation (WMI) is a scalable system management architecture that employs a unified, standards-based, extensible object-oriented interface. WMI provides you with a standard way to interact with system management information and the underlying WMI API. WMI is used primarily by system management application developers and administrators to access and operating system management information.
We need to implement the class provided in the. NET framwork inside the System.Management namespace.
Imports System.Management
Private Sub button3_click (ByVal sender as System.Object, ByVal e as System.EventArgs) Handles Button3.click
Dim Disk as Managementbaseobject
Dim Strresult as String
Dim Diskclass = New managementclass ("Win32_LogicalDisk")
Dim disks as Managementobjectcollection
disks = Diskclass.getinstances ()
For each disk in disks
strresult = ""
Strresult + = "Device ID:" & Disk ("DeviceID") & VbCrLf
Strresult + = "Disk Name:" & Disk ("name") & VbCrLf
Summary: In vb.net, you can get the hard drive information with API functions. Originally familiar with API functions VB6 programmers, you can make appropriate changes to the API function declaration after the call. You can also obtain disk information using the Scrrun.DLL of the FSO (file system object). In. NET Framwork, you can use WMI to get more detailed information about machine hardware (refer to the System.Management namespace).
Disclaimer: This copyright and interpretation of the right to Lee Honggen all, if necessary reprint, please retain the full content and this statement.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.