Ver Mensaje Individual
  #6 (permalink)  
Antiguo 05/06/2008, 13:10
Avatar de RsOfT
RsOfT
 
Fecha de Ingreso: marzo-2002
Ubicación: InterNET
Mensajes: 1.121
Antigüedad: 22 años, 2 meses
Puntos: 7
Respuesta: Saber información de mi Hardware utilizando VB.NET 2005

Aquí te va una clase que tiene muchas cosas más:

PublicClass clsSystemInformation
#Region"Variables"
Private _strComputerName AsString
Private _strManufacturer AsString
Private _StrModel AsString
Private _strOSName AsString
Private _strOSVersion AsString
Private _strSystemType AsString
Private _strTPM AsString
Private _strWindowsDir AsString
Private _decVelocidadProcesador AsDecimal
#EndRegion
#Region"Propiedades"
PublicReadOnlyProperty pr_ComputerName() AsString
Get
pr_ComputerName = _strComputerName
EndGet
EndProperty
PublicReadOnlyProperty pr_Manufacturer() AsString
Get
pr_Manufacturer = _strManufacturer
EndGet
EndProperty
PublicReadOnlyProperty pr_Model() AsString
Get
pr_Model = _StrModel
EndGet
EndProperty
PublicReadOnlyProperty pr_OsName() AsString
Get
pr_OsName = _strOSName
EndGet
EndProperty
PublicReadOnlyProperty pr_OSVersion() AsString
Get
pr_OSVersion = _strOSVersion
EndGet
EndProperty
PublicReadOnlyProperty pr_SystemType() AsString
Get
pr_SystemType = _strSystemType
EndGet
EndProperty
PublicReadOnlyProperty pr_TotalPhysicalMemory() AsString
Get
pr_TotalPhysicalMemory = _strTPM
EndGet
EndProperty
PublicReadOnlyProperty pr_WindowsDirectory() AsString
Get
pr_WindowsDirectory = _strWindowsDir
EndGet
EndProperty
PublicReadOnlyProperty pr_VelocidadProcesador() AsDecimal
Get
Return _decVelocidadProcesador
EndGet
EndProperty
#EndRegion
#Region"Constructor"
PublicSubNew()
Dim objMgmt AsNew Management.ManagementObject
Dim objMOS AsNew Management.ManagementObjectSearcher
objMOS = New Management.ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem")
ForEach objMgmt In objMOS.Get
_strOSName = objMgmt("name").ToString.Trim
_strOSVersion = objMgmt("version").ToString.Trim
_strComputerName = objMgmt("csname").ToString.Trim
_strWindowsDir = objMgmt("windowsdirectory").ToString.Trim
Next
objMOS = New Management.ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem")
ForEach objMgmt In objMOS.Get
_strManufacturer = objMgmt("manufacturer").ToString.Trim
_StrModel = objMgmt("model").ToString.Trim
_strSystemType = objMgmt("systemtype").ToString.Trim
_strTPM = objMgmt("totalphysicalmemory").ToString.Trim
Next
objMOS = New Management.ManagementObjectSearcher("SELECT * FROM Win32_Processor")
ForEach objMgmt In objMOS.Get
_decVelocidadProcesador = CDec(objMgmt("CurrentClockSpeed").ToString.Trim)
Next
objMOS.Dispose() : objMOS = Nothing
objMgmt.Dispose() : objMgmt = Nothing
EndSub
#EndRegion
EndClass
__________________
.::RsOfT::.
--El que se aferra a lo conocido, nunca conocerá lo desconocido--
--Es intentando lo imposible como se realiza lo posible--
--Es de pésimo gusto contentarse con algo mediocre cuando lo excelente está a nuestro alcance--