Micrsoft recommends you use the Path class, when you are playing with directories. The path class has a number of functions, here is a survey of a few:
1 | Dim theFile As String = "C:\test\test.doc" |
The first statement simply initializes a variable named ‘theFile’
Path.GetDirectoryName - is a method that pulls the path out of a variable. In this case the output would be “c:\test”.
Path.GetFileName - is a method that pulls the filename out of a variable. In this case the output would be “test.doc”