|
-
Jun 28th, 2011, 01:45 AM
#2
Re: POST 2: Storing text data in a file for program use
 Originally Posted by mk31369
I posted about this issue already and I did receive some helpful info from people, but unfortunately my problem still isn't resolved.
Here is what I would like to do:
- Store string data from a 'sign in' form into a text file. This text file must be one that is saved even after the user exits the program. The text file must also be one that will stay with the program even after it is published (executable).
- Be able to write to/read from the file for purposes of displaying some or all of that data on a form.
This is not a problem at all. Working with plain text for data storage gets awkward if the txt file size grows large, but for small files it's quite easy. One thing you should know about text files is that they are read/written continuously, so it's ok when you try to append something to the end of the file but inserting data in the middle will not be that easy.
 Originally Posted by mk31369
When I posted before, a couple of people suggested I use an Application Setting to do this - of type 'Specialized String Collection'.
A .settings file is great for storing the app settings, indeed this is how your settings should be stored.
 Originally Posted by mk31369
I tried this, but for some reason I could not get it to work. It was a good idea, but I need to be able to SEE the data that has been saved, and with a setting it seems like that is not easily done.
Perhaps, a bit more specific question about what exactly isn't working as it should be could help you to advance further.
 Originally Posted by mk31369
I've decided that I either need to use a simple text file or a 1-table database for this. I would prefer just a text file, but in either case, it needs to be part of the .exe when published.
Now, this part in bold I don't quite understand. While you can embed a text file in your executable you will only be able to read from it, but not write to. Self-modifying executables died a long time ago, in times of MS-DOS. Now, once .exe is built - it doesn't change. Besides, you said, yo need to be able to SEE the data that has been saved and storing your data in an executable file is not the best way to do it.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|