Public Function MyPath() As String
Dim sPath As String = Application.ExecutablePath
sPath = System.IO.Path.GetDirectoryName(sPath)
If sPath.EndsWith("\bin\Debug") Then
sPath = sPath.Substring(0, Len(sPath) - 10)
ElseIf sPath.EndsWith("\bin\Release") Then
sPath = sPath.Substring(0, Len(sPath) - 12)
End If
Return sPath
End Function
using Mypath
Dim fName As String = MyPath() & "\CnSetting.cn"