Public Class Memory
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_physicalmemory")
Dim moss As ManagementObjectSearcher = New ManagementObjectSearcher(mss, ob)
Dim queryCollection As ManagementObjectCollection = moss.Get
Public Function Names()
For Each getnow As ManagementObject In queryCollection
Names = getnow("name")
Next
End Function
Public Function Capacity()
For Each getnow As ManagementObject In queryCollection
Capacity = getnow("Capacity")
Next
End Function
Public Function DeviceLocator()
For Each getnow As ManagementObject In queryCollection
DeviceLocator = getnow("DeviceLocator")
Next
End Function
Public Function TotalWidth()
For Each getnow As ManagementObject In queryCollection
TotalWidth = getnow("TotalWidth")
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_physicalmemory")
Dim moss As ManagementObjectSearcher = New ManagementObjectSearcher(mss, ob)
Dim queryCollection As ManagementObjectCollection = moss.Get
Public Function Names()
For Each getnow As ManagementObject In queryCollection
Names = getnow("name")
Next
End Function
Public Function Capacity()
For Each getnow As ManagementObject In queryCollection
Capacity = getnow("Capacity")
Next
End Function
Public Function DeviceLocator()
For Each getnow As ManagementObject In queryCollection
DeviceLocator = getnow("DeviceLocator")
Next
End Function
Public Function TotalWidth()
For Each getnow As ManagementObject In queryCollection
TotalWidth = getnow("TotalWidth")
Next
End Function
End Class
Please SUBSCRIBE to get new articles directly into your Email inbox!
تعليقات
إرسال تعليق