An object-oriented programming language developed by Microsoft that can be used in .NET.
ManagementObjectCollection Error
Hello experts,
Any idea how to eliminate this error:
Dim m_drive As String = Path.GetPathRoot(Environment.SystemDirectory)
m_drive = m_drive.Substring(0, m_drive.Length - 1)
Dim m_searcher As New ManagementObjectSearcher("root\Microsoft\Windows\Storage", "SELECT * FROM MSFT_PhysicalDisk WHERE DeviceId = " + GetPhysicalDriveId(m_drive, True))
Dim m_query As ManagementObject = TryCast(m_searcher.Get(0), ManagementObject)
Error: Class 'System.Management.ManagementObjectCollection' cannot be indexed because it has no default property.
No idea why adding System.Linq will eliminate it, but anyway not to import System.Linq and get rid of this error?
Thanksss :)