Tip Bank

DevX - Software Development Resource

IsDriveReady – Returns whether a drive is ready

‘ Returns a boolean indicating whether a given drive is ready’ Example: check if the floppy disk drive is ready’ Debug.WriteLine(IsDriveReady(“a”))Function IsDriveReady(ByVal driveLetter As String) As Boolean If driveLetter.Length =

DevX - Software Development Resource

SearchFileOnPath – Searching a file on the system

Shared Function _ SearchPath(ByVal tartPath As String, ByVal fileName As String, _ ByVal extension As String, ByVal bufferLength As Integer, _ ByVal buffer As System.Text.StringBuilder, ByVal filePart As String) As

DevX - Software Development Resource

SearchFileInDirTree – Searches a file on a directory tree

Shared Function _ SearchTreeForFile(ByVal rootPath As String, ByVal inputPathName As String, _ ByVal outputPathBuffer As System.Text.StringBuilder) As BooleanEnd Function’ Returns the complete path+name of the filename or a null string

DevX - Software Development Resource

CompactPathToControl – Shorten a path by using ellipses

Shared Function _ GetWindowDC(ByVal hWnd As Integer) As IntegerEnd Function Shared Function _ PathCompactPath(ByVal hDC As Integer, _ ByVal pathBuffer As System.Text.StringBuilder, _ ByVal dx As Integer) As BooleanEnd Function’

DevX - Software Development Resource

CompareFiles – Comparing two binary/text files

‘ Returns a boolean indicating whether two files are equal’ Example: Debug.WriteLine(CompareFiles(“D:File1.mdb”, “D:File2.mdb”))Function CompareFiles(ByVal path1 As String, ByVal path2 As String) As Boolean Dim file1 As New System.IO.FileInfo(path1) Dim file2