'C# version coming with v1.0; Full Release will be on HackForums.net, alpha releases here, beta & alpha versions here.
'UNDER CONSTRUCTION. 30% COMPLETE. ALPHA RELEASE.
'Lucid Development
'Advanced Systems Analysis ---- UNDER CONSTRUCTION. 30% COMPLETE. ALPHA RELEASE.
'Featuers:
' OperatingSystem Information: (4% done)
' OS Version
' Name, Major, Minor, Build, Revision
' CPU Information: (63% done)
' AddressWidth
' Architecture
' Availability
' Caption
' COnfigManagerErrorCode
' ConfigManagerUserConfig
' CpuStatus
' CreationClassName
' CurrentClockSpeed
' CurrentVoltage
' DataWidth
' Description
' DeviceID
' ErrorCleared
' ErrorDescription
' ExtClock
' Family
' InstallDate
' L2CacheSize
' L2CacheSpeed
' L3CacheSize
' L3CacheSpeed
' LastErrorCode
' Level
' LoadPercentage
' Manufacturer
' MaxClockSpeed
' Name
' NumberOfCores
' NumberOfLogicalProcessors
' OtherFamilyDescription
' PNPDeviceID
' User Information (1% done)
' User Name
' Screen Resolution
' Computer Info (.5% done)
' WinDir()
Imports System.Management
Namespace LucidDevelopment ' ASA v0.3-b12-ALPHA
Class OSVersionInfo
'These are basics, since these are easy to grab I'm not including very many in this version. v2 of this class will be more extensive
Public Function GetOSVersion() As String
Select Case Environment.OSVersion.Platform
Case PlatformID.Win32S
Return "Win 3.1"
Case PlatformID.Win32Windows
Select Case Environment.OSVersion.Version.Minor
Case 0
Return "Win95"
Case 10
Return "Win98"
Case 90
Return "WinME"
Case Else
Return "Unknown"
End Select
Case PlatformID.Win32NT
Select Case Environment.OSVersion.Version.Major
Case 3
Return "NT 3.51"
Case 4
Return "NT 4.0"
Case 5
Select Case _
Environment.OSVersion.Version.Minor
Case 0
Return "Win2000"
Case 1
Return "WinXP"
Case 2
Return "Win2003"
End Select
Case 6
Return "Vista/Windows 7"
Case Else
Return "Unknown"
End Select
Case PlatformID.WinCE
Return "Win CE"
End Select
Return "Unknown"
End Function
Public Function GetVersionMajor() As String
Return Environment.OSVersion.Version.Major.ToString
End Function
Public Function GetVersionMinor() As String
Return Environment.OSVersion.Version.Minor.ToString
End Function
Public Function GetVersionBuild() As String
Return Environment.OSVersion.Version.Build.ToString
End Function
Public Function GetVersionRevision() As String
Return Environment.OSVersion.Version.Revision.ToString
End Function
End Class
Class CPUInfo
Dim searcher As New ManagementObjectSearcher("root\CIMV2", "SELECT * FROM Win32_Processor")
Private Function getObj(s As String) As String
Try
For Each queryObj As ManagementObject In searcher.[Get]()
Return queryObj(s)
Next
Catch ex As Exception
Return "Feil i søket '" & s & "' - " & ex.ToString
End Try
Return "Verdi Ukjent"
End Function
Public Function AddressWidth() As String
Return getObj("AddressWidth")
End Function
Public Function Architecture() As String
Return getObj("Architecture")
End Function
Public Function Availability() As String
Return getObj("Availability")
End Function
Public Function Caption() As String
Return getObj("Caption")
End Function
Public Function ConfigManagerErrorCode() As String
Return getObj("ConfigManagerErrorCode")
End Function
Public Function ConfigManagerUserConfig() As String
Return getObj("ConfigManagerUserConfig")
End Function
Public Function CpuStatus() As String
Return getObj("CpuStatus")
End Function
Public Function CreationClassName() As String
Return getObj("CreationClassName")
End Function
Public Function CurrentClockSpeed() As String
Return getObj("CurrentClockSpeed")
End Function
Public Function CurrentVoltage() As String
Return getObj("CurrentVoltage")
End Function
Public Function DataWidth() As String
Return getObj("DataWidth")
End Function
Public Function Description() As String
Return getObj("Description")
End Function
Public Function DeviceID() As String
Return getObj("DeviceID")
End Function
Public Function ErrorCleared() As String
Return getObj("ErrorCleared")
End Function
Public Function ErrorDescription() As String
Return getObj("ErrorDescription")
End Function
Public Function ExtClock() As String
Return getObj("ExtClock")
End Function
Public Function Family() As String
Return getObj("Family")
End Function
Public Function InstallDate() As String
Return getObj("InstallDate")
End Function
Public Function L2CacheSize() As String
Return getObj("L2CacheSize")
End Function
Public Function L2CacheSpeed() As String
Return getObj("L2CacheSpeed")
End Function
Public Function L3CacheSize() As String
Return getObj("L3CacheSize")
End Function
Public Function L3CacheSpeed() As String
Return getObj("L3CacheSpeed")
End Function
Public Function LastErrorCode() As String
Return getObj("LastErrorCode")
End Function
Public Function Level() As String
Return getObj("Level")
End Function
Public Function LoadPercentage() As String
Return getObj("LoadPercentage")
End Function
Public Function Manufacturer() As String
Return getObj("Manufacturer")
End Function
Public Function MaxClockSpeed() As String
Return getObj("MaxClockSpeed")
End Function
Public Function Name() As String
Return getObj("Name")
End Function
Public Function NumberOfCores() As String
Return getObj("NumberOfCores")
End Function
Public Function NumberOfLogicalProcessors() As String
Return getObj("NumberOfLogicalProcessors")
End Function
Public Function OtherFamilyDescription() As String
Return getObj("OtherFamilyDescription")
End Function
Public Function PNPDeviceID() As String
Return getObj("PNPDeviceID")
End Function
Public Function CPUID() As String
Dim computer As String = "."
Dim wmi As Object = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & computer & "\root\cimv2")
Dim processors As Object = wmi.ExecQuery("Select * from " & "Win32_Processor")
Dim cpu_ids As String = ""
For Each cpu As Object In processors
cpu_ids = cpu_ids & ", " & cpu.ProcessorId
Next cpu
If cpu_ids.Length > 0 Then cpu_ids = cpu_ids.Substring(2)
Return cpu_ids
End Function
Public Function SystemSerialNumber() As String
' Get the Windows Management Instrumentation object.
Dim wmi As Object = GetObject("WinMgmts:")
' Get the "base boards" (mother boards).
Dim serial_numbers As String = ""
Dim mother_boards As Object = _
wmi.InstancesOf("Win32_BaseBoard")
For Each board As Object In mother_boards
serial_numbers &= ", " & board.SerialNumber
Next board
If serial_numbers.Length > 0 Then serial_numbers = _
serial_numbers.Substring(2)
Return serial_numbers
End Function
End Class
Class UserInfo
Public Function UserName() As String
Return SystemInformation.UserName
End Function
Public Function Resolution() As String
Return "(" & SystemInformation.WorkingArea.Width & ", " & SystemInformation.WorkingArea.Height & ")"
End Function
End Class
Class ComputerInfo
Public Function WinDir() As String
Return Environ$("windir")
End Function
End Class
End Namespace