How to: Parse File Paths in Visual Basic
Updated: July 20, 2015
For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.
The FileSystem object offers a number of useful methods when parsing file paths.
The CombinePath method takes two paths and returns a properly formatted combined path.
The 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.
CombinePathmethod, supplying the directory and name. This example takes the strings
fileNamecreated in the previous example, combines them, and displays the result.