From: Armin Zingler on
Anthony Papillion schrieb:
> 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

Show us the real code. :-) I count 3 quotation marks in the 1st line. Number
must be even.

In general, use Sytem.IO.Path.Combine to build pathes. No backslash twiddling
anymore. However, I don't have an answer to why you get that path. Here, BaseDirectory
returns the path of the directory containing the Exe file. Haven't use the property
before; I've always extracted the path from Application.ExecutablePath. Maybe
you can give it a try also.



--
Armin
From: Anthony Papillion on
Thanks for the answer everyone!
Definitely fixed my problem.

Anthony