Geez, Its been a pain in the freakin ass to get application path in .NET. Here you go buddy's
VB Code:
Private Function GetAppPath() As String Dim l_intCharPos As Integer = 0, l_intReturnPos As Integer Dim l_strAppPath As String l_strAppPath = System.Reflection.Assembly.GetExecutingAssembly.Location() While (1) l_intCharPos = InStr(l_intCharPos + 1, l_strAppPath, "\", CompareMethod.Text) If l_intCharPos = 0 Then If Right(Mid(l_strAppPath, 1, l_intReturnPos), 1) <> "\" Then Return Mid(l_strAppPath, 1, l_intReturnPos) & "\" Else Return Mid(l_strAppPath, 1, l_intReturnPos) End If Exit Function End If l_intReturnPos = l_intCharPos End While End Function




Reply With Quote