How to: Parse File Paths in Visual Basic
The My.Computer.FileSystem Object offers a number of useful methods when parsing file paths.
The My.Computer.FileSystem.CombinePath Method takes two paths and returns a properly formatted combined path.
The My.Computer.FileSystem.GetParentPath Method returns the absolute path of the parent of the provided path.
Do not make decisions about the contents of the file based on the file name extension. For example, the file Form1.vb may not be a Visual Basic source file.
To determine a file's name and path
To combine a file's name and directory to create the full path
Use the CombinePath method, supplying the directory and name. This example takes the strings folderPath and fileName created in the previous example, combines them, and displays the result.