informacion sistema
Publicado por sergio (16 intervenciones) el 31/10/2004 16:51:02
hola
quiero obtener la informacion del sistema en .NET,pero con este codigo las estructuras de datos permanecen a 0 y no acumulan informacion.
Structure SYSTEM_INFO
Dim dwOemID As Long
Dim dwPageSize As Long
Dim lpMinimumApplicationAddress As Long
Dim lpMaximumApplicationAddress As Long
Dim dwActiveProcessorMask As Long
Dim dwNumberOrfProcessors As Long
Dim dwProcessorType As Long
Dim wAllocationGranularity As Long
Dim dwReserved As Long
End Structure
Structure OSVERSIONINFO
Dim dwOSVersionInfoSize As Long
Dim dwMajorVersion As Long
Dim dwMinorVersion As Long
Dim dwBuildNumber As Long
Dim dwPlatformId As Long
Dim szCSDVersion As String
End Structure
Structure MEMORYSTATUS
Dim dwLength As Long
Dim dwMemoryLoad As Long
Dim dwTotalPhys As Long
Dim dwAvailPhys As Long
Dim dwTotalPageFile As Long
Dim dwAvailPageFile As Long
Dim dwTotalVirtual As Long
Dim dwAvailVirtual As Long
End Structure
verinfo.dwOSVersionInfoSize = Len(verinfo)
Try
ret = GetVersionEx(verinfo)
If ret = 0 Then
MsgBox("Error Obteniendo Information de la Version")
End
End If
Catch ex As NullReferenceException
Beep()
End Try
Try
GetSystemInfo(sysinfo)
Catch ex As NullReferenceException
Beep()
End Try
quiero obtener la informacion del sistema en .NET,pero con este codigo las estructuras de datos permanecen a 0 y no acumulan informacion.
Structure SYSTEM_INFO
Dim dwOemID As Long
Dim dwPageSize As Long
Dim lpMinimumApplicationAddress As Long
Dim lpMaximumApplicationAddress As Long
Dim dwActiveProcessorMask As Long
Dim dwNumberOrfProcessors As Long
Dim dwProcessorType As Long
Dim wAllocationGranularity As Long
Dim dwReserved As Long
End Structure
Structure OSVERSIONINFO
Dim dwOSVersionInfoSize As Long
Dim dwMajorVersion As Long
Dim dwMinorVersion As Long
Dim dwBuildNumber As Long
Dim dwPlatformId As Long
Dim szCSDVersion As String
End Structure
Structure MEMORYSTATUS
Dim dwLength As Long
Dim dwMemoryLoad As Long
Dim dwTotalPhys As Long
Dim dwAvailPhys As Long
Dim dwTotalPageFile As Long
Dim dwAvailPageFile As Long
Dim dwTotalVirtual As Long
Dim dwAvailVirtual As Long
End Structure
verinfo.dwOSVersionInfoSize = Len(verinfo)
Try
ret = GetVersionEx(verinfo)
If ret = 0 Then
MsgBox("Error Obteniendo Information de la Version")
End
End If
Catch ex As NullReferenceException
Beep()
End Try
Try
GetSystemInfo(sysinfo)
Catch ex As NullReferenceException
Beep()
End Try
Valora esta pregunta


0