1 Replies - 740 Views - Last Post: 04 October 2012 - 07:48 AM Rate Topic: -----

#1 King of the Nerds  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 3
  • Joined: 03-October 12

How to edit multiple text file lines

Posted 04 October 2012 - 05:23 AM

Hi

Im making a Server Wrapper for Minecraft, but I can't figure out how to edit multiple lines in one text file. I need to edit a text file like this:

Server Name: <edit>
Gamemode: <edit>
Server IP:
Server Port:

etc. etc.

If you need any more information, please mention it.


- K o t N
Is This A Good Question/Topic? 0
  • +

Replies To: How to edit multiple text file lines

#2 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1623
  • View blog
  • Posts: 5,200
  • Joined: 25-September 09

Re: How to edit multiple text file lines

Posted 04 October 2012 - 07:48 AM

Use a streamreader to read in the lines of the text file.
Use string.Split to put the information in their proper textboxes

Make the changes in the appropriate textboxes

Use a streamwriter to write the information back to the text file.

Basically, you're reading in all the lines and getting the information from them
Allowing the user to change the current information
Overwriting the textfile with the updated information back in the same format.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1