Copy an Array Faster, Redux
Simple is usually best. VB4 introduced direct assignment to Byte arrays, and VB5 later expanded that capability to include other array types as well. This code does the same thing
Simple is usually best. VB4 introduced direct assignment to Byte arrays, and VB5 later expanded that capability to include other array types as well. This code does the same thing
Locking an NT workstation has never been easy. Windows 2000 has a new function, LockWorkStation, that can lock the machine instantly with a single API call: Private Declare Function LockWorkStation
If you want to use an object in the middle of a routine and avoid declaring the object in the routine, simply use this syntax: With New .End With This
Enum DomainRole As Integer StandaloneWorkstation = 0 MemberWorkstation = 1 StandaloneServer = 2 MemberServer = 3 BackupDomainController = 4 PrimaryDomainController = 5End Enum’ Returns the domain role’ Requires a reference
Enum NetworkAvailability As Integer Other = 1 Unknown = 2 RunningFullPower = 3 Warning = 4 InTest = 5 NotApplicable = 6 PowerOff = 7 OffLine = 8 OffDuty =
‘ Returns the physical memory amount, in bytes’ Requires a reference to System.Management and the respective ImportsFunction GetPhysicalMemory() As Long Dim mos As New ManagementObjectSearcher _ (“SELECT * FROM Win32_ComputerSystem”)
‘ Returns the free physical memory amount, in bytes’ Requires a reference to System.Management and the respective ImportsFunction GetFreePhysicalMemory() As Long Dim mos As New ManagementObjectSearcher _ (“SELECT * FROM
‘ Returns the computer model’ Requires a reference to System.Management and the respective ImportsFunction GetComputerModel() As String Dim mos As New ManagementObjectSearcher _ (“SELECT * FROM Win32_ComputerSystem”) Dim mo As
‘ Returns the computer manufacturer name’ Requires a reference to System.Management and the respective ImportsFunction GetComputerManufacturer() As String Dim mos As New ManagementObjectSearcher _ (“SELECT * FROM Win32_ComputerSystem”) Dim mo