Dim strAppDir As String = Path.GetDirectoryName( _
Assembly.GetExecutingAssembly().GetName().CodeBase)
Dim strFullPathToMyFile As String = Path.Combine(strAppDir, "myFileName.txt")
MessageBox.Show(String.Format("Path to the application is: '{0}'." + _
"Full path to the file in the application folder is: '{1}'", _
strAppDir, strFullPathToMyFile))
String strAppDir = Path.GetDirectoryName(
Assembly.GetExecutingAssembly().GetName().CodeBase);
String strFullPathToMyFile = Path.Combine(strAppDir, "fileName.txt");
MessageBox.Show(String.Format("Path to the application is: '{0}'." +
"Full path to the file in the application folder is: '{1}'",
strAppDir, strFullPathToMyFile));