By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
463,088 Members | 596 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 463,088 IT Pros & Developers. It's quick & easy.

Edit a text file

P: 1
I am looking to create a program that is able to edit a text file that is not located within the program. This particular text file is always in the exact same location and is always named the exact same, and I would like to find a way to make it easily editable.

How do I edit the text file (a single line needs to be changed) using a Visual Basic 2008 program? Please help me, I will be VERY appreciative!

EDIT: I use Visual Basic 2008 Express Edition.

2ND EDIT: Here's a better explanation.

There is a file located at C:\Program Files\Something\thefile.txt.
thefile.txt is a one lined file that changes how the program Something connects to the internet. I need to create a program that can modify this file with a button click. There are two specific ways to change it and one way that is user-entered. How do I make the program change the single line in this text file to say what i need it to say?
Dec 9 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 5K+
P: 8,434
Do you need your code to see what's currently in the file? If not, just write over the top of it each time.
Dec 10 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.