Tip Bank

DevX - Software Development Resource

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

DevX - Software Development Resource

Lock Windows 2000 Instantly

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

DevX - Software Development Resource

GetDomainRole – Retrieving the domain role

Enum DomainRole As Integer StandaloneWorkstation = 0 MemberWorkstation = 1 StandaloneServer = 2 MemberServer = 3 BackupDomainController = 4 PrimaryDomainController = 5End Enum’ Returns the domain role’ Requires a reference

DevX - Software Development Resource

GetPhysicalMemory – Retrieving the physical memory amount

‘ 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”)

DevX - Software Development Resource

GetComputerModel – Retrieving the computer model

‘ 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