How to VB.Net Path Class
VB.NET provides effective ways of dealing with filenames and paths by using System.IO namespace . The Path Class performs operations on String instances that contain file or directory path information. Path Class returns a string that can contain absolute or relative location information.
The following are the some important operations in VB.Net Path Class:
GetDirectoryName - Returns the directory information for the specified path string.
GetExtension - Returns the extension of the specified path string.
GetFileName - Returns the file name and extension of the specified path string.
GetFileNameWithoutExtension - Returns the file name of the specified path string without the extension.
GetFullPath - Returns the absolute path for the specified path string.
Get Current Application Path
VB.Net Class application in System.Windows.Forms namespace has static property called ExecutablePath . Inorder to get only the folder part of the path, use static method GetDirectoryName of Path class.
It will return the current path of the .exe file .