Edit a text file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Xicon
    New Member
    • Dec 2007
    • 1

    Edit a text file

    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?
    Last edited by Xicon; Dec 9 '07, 03:39 AM. Reason: Adding Version and Explanation
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Do you need your code to see what's currently in the file? If not, just write over the top of it each time.

    Comment

    Working...