Write to a resource text file in vb

Hi
Hi

I am new to visual studio and want my application to write info to a text file so that it can remember settings.  

I have an "Accounts.txt" in the resources and when the user adds a new account,  the code copies and renames a blank database file but I need to keep track of these filenames and where they are saved so that the user can select the accounts as needed.

Any guidance or suggestions would be appreciated.

This is rather basic I know but I need a bit of a kick start!
LVL 4
rowanscottAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cadsjoCommented:
You can write them to a file with the code provided below.

Afterwards you can read each line of the file and split on ";" for example.

Private Sub WriteToFile()
dim strFolder as string = "C:\"
dim strFileName as string = "Textfile.txt"

        Using sw As StreamWriter = File.OpenWrite(Path.Combine(strFolder strFileName))

            sw.WriteLine("Account 1; Path")
            sw.WriteLine("Account 2; Path2")

            sw.Close()

        End Using
End Sub

HTH,
Cadsjo
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rowanscottAuthor Commented:
Thanks cadsjo

I think I can follow that OK but how do I get the path to the text file.  It would need to reside in C:\Program Files somewhere I suppose.
0
cadsjoCommented:
You can use Application.ExecutablePath. This returns the path where the application is installed.

You don't have to search yourself.

Cadsjo
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.