Public Class CD_ROM
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_cdromdrive")
Dim moss As ManagementObjectSearcher = New ManagementObjectSearcher(mss, ob)
Dim queryCollection As ManagementObjectCollection = moss.Get
Public Function CdRomName() As System.Collections.ObjectModel.Collection(Of String)
CdRomName = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
CdRomName.Add(getnow("name"))
Next
End Function
Public Function CdRomManufacturer() As System.Collections.ObjectModel.Collection(Of String)
CdRomManufacturer = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
CdRomManufacturer.Add(getnow("Manufacturer"))
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("Availability"))
Next
End Function
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("Caption"))
Next
End Function
Public Function ConfigManagerErrorCode() As System.Collections.ObjectModel.Collection(Of String)
ConfigManagerErrorCode = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
ConfigManagerErrorCode.Add(getnow("ConfigManagerErrorCode"))
Next
End Function
Public Function Drive() As System.Collections.ObjectModel.Collection(Of String)
Drive = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
Drive.Add(getnow("Drive"))
Next
End Function
Public Function MediaType() As System.Collections.ObjectModel.Collection(Of String)
MediaType = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
MediaType.Add(getnow("MediaType"))
Next
End Function
Public Function MediaLoaded() As System.Collections.ObjectModel.Collection(Of String)
MediaLoaded = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
MediaLoaded.Add(getnow("MediaLoaded"))
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_cdromdrive")
Dim moss As ManagementObjectSearcher = New ManagementObjectSearcher(mss, ob)
Dim queryCollection As ManagementObjectCollection = moss.Get
Public Function CdRomName() As System.Collections.ObjectModel.Collection(Of String)
CdRomName = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
CdRomName.Add(getnow("name"))
Next
End Function
Public Function CdRomManufacturer() As System.Collections.ObjectModel.Collection(Of String)
CdRomManufacturer = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
CdRomManufacturer.Add(getnow("Manufacturer"))
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("Availability"))
Next
End Function
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("Caption"))
Next
End Function
Public Function ConfigManagerErrorCode() As System.Collections.ObjectModel.Collection(Of String)
ConfigManagerErrorCode = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
ConfigManagerErrorCode.Add(getnow("ConfigManagerErrorCode"))
Next
End Function
Public Function Drive() As System.Collections.ObjectModel.Collection(Of String)
Drive = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
Drive.Add(getnow("Drive"))
Next
End Function
Public Function MediaType() As System.Collections.ObjectModel.Collection(Of String)
MediaType = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
MediaType.Add(getnow("MediaType"))
Next
End Function
Public Function MediaLoaded() As System.Collections.ObjectModel.Collection(Of String)
MediaLoaded = New System.Collections.ObjectModel.Collection(Of String)
For Each getnow As ManagementObject In queryCollection
MediaLoaded.Add(getnow("MediaLoaded"))
Next
End Function
End Class
Please SUBSCRIBE to get new articles directly into your Email inbox!
تعليقات
إرسال تعليق