devxlogo

XML with Visual Basic and VB.NET

DevX - Software Development Resource

GetDomainName – Retrieving the domain name

‘ Returns the domain name’ Requires a reference to System.Management and the respective ImportsFunction GetDomainName() As String Dim mos As New ManagementObjectSearcher _ (“SELECT * FROM Win32_ComputerSystem”) Dim mo As

DevX - Software Development Resource

Hex – Convert from decimal to hexadecimal

‘ convert from decimal to hexadecimal’ if you pass the Digits argument, the result is truncated to that number of ‘ digits” you should always specify Digits if passing negative

DevX - Software Development Resource

Sort and Reverse—Sort a ListView

This routine performs the standard column sorting on a ListView control found in many commercial applications, such as Windows Explorer and Outlook. Using this routine, the ListView sorts itself automatically

DevX - Software Development Resource

Another Way of Handling Null Database Fields

A compact way of handling null database fields is as follows: txtText1.text = Format(rs!Field) If rs!Field is null, Format(rs!Field) will resolve to an empty string.Otherwise the value in the recordset

DevX - Software Development Resource

Show the contents of the Recycle Bin folder

You can use the ShellExecute API function to programmatically open a window of Explorer and display the contents of the Recycle Bin. This is the function’s declare: Private Declare Function