A
Anthony Papillion
Hello again everyone,
I'm developing an application that depends on an external data file. I've
created a new folder within the project and then added the data file to it.
I called the folder resources.
Now, I'm trying to create a StreamReader to use the file. This is the code
I'm using:
Try
Dim reader as New
StreamReader("System.AppDomain.CurrentDomain.BaseDirectory() &
"resources\datafile.dat", true)
Catch ex As Exception
MsgBox("Could not open file")
End Try
Now, you would think that this would work, right (maybe not)? Every time I
run the program, my catch() block is activated. So, I put in a
MsgBox(System.AppDomain.CurrentDomain.BaseDirectory())
at the beginning of the Form_Load() event. I compliled, published, and
installed the application. When I start the application, the path displayed
in the MsgBox is something like
"C:\Users\Anthony\AppData\Local\Apps\2.0\SOME_LONG_STRING\datafile.ion_SOME_LONG_STRING"
WTF?
Shouldn't this be in C:\PROGRAM FILES\MY APP?
Can anyone help me sort this?
Thanks!
Anthony
I'm developing an application that depends on an external data file. I've
created a new folder within the project and then added the data file to it.
I called the folder resources.
Now, I'm trying to create a StreamReader to use the file. This is the code
I'm using:
Try
Dim reader as New
StreamReader("System.AppDomain.CurrentDomain.BaseDirectory() &
"resources\datafile.dat", true)
Catch ex As Exception
MsgBox("Could not open file")
End Try
Now, you would think that this would work, right (maybe not)? Every time I
run the program, my catch() block is activated. So, I put in a
MsgBox(System.AppDomain.CurrentDomain.BaseDirectory())
at the beginning of the Form_Load() event. I compliled, published, and
installed the application. When I start the application, the path displayed
in the MsgBox is something like
"C:\Users\Anthony\AppData\Local\Apps\2.0\SOME_LONG_STRING\datafile.ion_SOME_LONG_STRING"
WTF?
Shouldn't this be in C:\PROGRAM FILES\MY APP?
Can anyone help me sort this?
Thanks!
Anthony