If the data does not change, and it is so small, I would simply hard code it into the code, by declaring variables.
If you do not want to do this, you can always create an installer that copies this file into the appropriate directory. If you do not like this way either, you can add it as an embedded resource. Here is an example: http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=75 On Tue, Jun 16, 2009 at 1:07 AM, raoul <[email protected]> wrote: > > Sorry for the newbie question, but I can't quite work this out, and I > can't imagine it is that difficult. I am using Visualbasic 2005 > express. > > I have written a program that requires a bunch of data to be read from > a file. It currently opens the data file using streamreader, and > reads in the contents of the file into a string. I go through the > string and seperate the values into the appropriate variable arrays > using a space to deliminate the data columns. > > All of this works just fine. However, it requires me to include the > data file with the executable as a seperate file and the user has to > put them in the same directory. I do not want to have this data file > as a seperate file, and want to somehow add it to my project so that > it is an embedded resource. > > I can "add" the file to my project, but I can't see how to reference > it now and read the data from it. Again, the file is merely a few > columns of data. > > TIA > > -Raoul > >
