Anonymous560487

hey,

i have written a program which reads from some text files during the loading of the form.
currently, i've set the location of the filename specifically

but is there a way to put those text files into the vb file, so that the location is always the same and the user does not have to worry about puttin the text files in the right place

can anyone help plz


Re: Visual Basic Express Edition embedding the text file into the program files possible?

JohnWein

You could put the text data in your Settings file or as String constants in a module.



Re: Visual Basic Express Edition embedding the text file into the program files possible?

DMan1

In addition to using a settings file you can:

1. Embed the files as a resource

2. Include the files in your setup project

3. or if you use "Click-once" make sure the files are located in a project directory with "Copy To Output Directory" set to "Copy Always"

using #2 or #3 you can use an apploication relative reference to retrieve the files:

Dim MyFIlePath as String = Application.StartupPath &"\MyFileDirectory\MyFileName.txt"