Please let other users know how useful this tip is by rating it at the bottom of the page. Do you have a tip or code of your own you'd like to share? Submit it here.
This code determines the current path where your source code resides when it's not in the bin folder.
Dim strAppPath, strFile Dim strAppFolder As String = _ System.IO.Path.GetFullPath (Application.StartupPath & "..") 'add a at the end if it doesn't have one If strAppFolder.EndsWith("") Then strAppPath = strAppFolder & "test.txt" Else strAppPath = strAppFolder & "test.txt" End If MessageBox.Show(strAppPath)