Public Class ParallelPort
Dim con As ConnectionOptions = New ConnectionOptions
Dim machineName As String = System.Environment.MachineName
Dim mss As ManagementScope = New ManagementScope("\\" + machineName + "\root\cimv2", con)
Dim ob As ObjectQuery = New ObjectQuery("SELECT * FROM Win32_ParallelPort")
Dim moss As ManagementObjectSearcher = New ManagementObjectSearcher(mss, ob)
Dim queryCollection As ManagementObjectCollection = moss.Get
Public Function Caption() As System.Collections.ObjectModel.Collection(Of String)
Caption = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
Caption.Add(getnow.Item("caption"))
Next
End Function
Public Function Availability() As System.Collections.ObjectModel.Collection(Of String)
Availability = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
Availability.Add(getnow.Item("Availability"))
Next
End Function
Public Function PNPDeviceID() As System.Collections.ObjectModel.Collection(Of String)
PNPDeviceID = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
PNPDeviceID.Add(getnow.Item("PNPDeviceID"))
Next
End Function
Public Function PowerManagementSupported() As System.Collections.ObjectModel.Collection(Of String)
PowerManagementSupported = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
PowerManagementSupported.Add(getnow.Item("PowerManagementSupported"))
Next
End Function
End Class
Please SUBSCRIBE to get new articles directly into your Email inbox!
Dim con As ConnectionOptions = New ConnectionOptions
Dim machineName As String = System.Environment.MachineName
Dim mss As ManagementScope = New ManagementScope("\\" + machineName + "\root\cimv2", con)
Dim ob As ObjectQuery = New ObjectQuery("SELECT * FROM Win32_ParallelPort")
Dim moss As ManagementObjectSearcher = New ManagementObjectSearcher(mss, ob)
Dim queryCollection As ManagementObjectCollection = moss.Get
Public Function Caption() As System.Collections.ObjectModel.Collection(Of String)
Caption = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
Caption.Add(getnow.Item("caption"))
Next
End Function
Public Function Availability() As System.Collections.ObjectModel.Collection(Of String)
Availability = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
Availability.Add(getnow.Item("Availability"))
Next
End Function
Public Function PNPDeviceID() As System.Collections.ObjectModel.Collection(Of String)
PNPDeviceID = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
PNPDeviceID.Add(getnow.Item("PNPDeviceID"))
Next
End Function
Public Function PowerManagementSupported() As System.Collections.ObjectModel.Collection(Of String)
PowerManagementSupported = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
PowerManagementSupported.Add(getnow.Item("PowerManagementSupported"))
Next
End Function
End Class
Please SUBSCRIBE to get new articles directly into your Email inbox!
تعليقات
إرسال تعليق