Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Why don't you just open it like this:Quoted
I'd like to know the path to open a configuration file in the same directory.
Jabaco Source |
|
1 |
Dim file as vbfilehandler = open "yourfile" |
Jabaco Source |
|
1 |
Dim file2 as vbfilehandler = open app.path + "" + "yourfile" |
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
Public AppPath As String Public Sub Form_Load() AppPath = GetAppPath MsgBox AppPath End Sub Public Function GetAppPath() As String Dim appURL As URL appURL = getClass.getResource(".") Dim s As String = appURL.getPath GetAppPath = Replace(s, "%20", " ") End Function |
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
Option Explicit Public AppPath As String Public Sub Form_Load() AppPath = GetAppPath() MsgBox AppPath End Sub Public Function GetAppPath() As String Dim classPath As String = System.getProperty("java.class.path") Dim pathSeparator As String = System.getProperty("path.separator") Dim fileSeparator As String = System.getProperty("file.separator") Dim cp() As String Dim s As String cp = Split(classPath, pathSeparator) s = cp(0) If Right(s, 8) = ".exe.jar" Then cp = Split(s, fileSeparator) s = Left(s, Len(s) - Len(cp(UBound(cp))) - 1) End If GetAppPath = s End Function |
Trainee
Date of registration: Jul 11th 2014
About me: A beginner programmer.
Location: ...Jabaco Academy
Occupation: i have some but still not enough...
Hobbies: Jabaco
This post has been edited 1 times, last edit by "spysonic" (Aug 26th 2014, 2:55am)