-
Oct 7th, 2009, 04:38 PM
#1
Thread Starter
New Member
League organizer project
Hey all im new here and was wondering if anyone could give me a hand with my new project...
its a League Organizer,
basicly ive started it off with 16 teams and end up with 1(winner)
16 box's on the far left, then 8, then 4, then 2, then 1
the 16 box's have "Team 1" "Team 2" etc...
ive put a new/clear/open/save button in that order.
BUT this is my problem..
when i save(Save Button) the text file saves all the text wrong it ends up like this...
Team 1Team 2Team 3Team 4 Etc...
but i want it to save like this
Team 1
Team 2
Team 3
Team 4
Etc...
the code is...
Code:
Dim Save As New SaveFileDialog
Save.Filter = "Text Files (*.txt)|*.txt|ALL FILES (*.*)|*.*"
Save.Title = "Save File"
Save.CheckPathExsists = True
Save.ShowDialog(Me)
Try
My.Computer.FileSystem.WriteAllText(Save.FileName, TextBox1.Text, False
My.Computer.FileSystem.WriteAllText(Save.FileName, TextBox2.Text, True
My.Computer.FileSystem.WriteAllText(Save.FileName, TextBox3.Text, True
etc..
Where am i going wrong?
Please help, many thanks
Last edited by samislost; Oct 7th, 2009 at 04:56 PM.
-
Oct 7th, 2009, 06:15 PM
#2
Re: League organizer project
You're just appending text each time without adding any line breaks.
First up, don't call WriteAllText repeatedly. It's very inefficient because you're opening and closing the same file over and over. Either call WriteAllLines once, which will also add line breaks between each element of the array you specify, or else open a StreamWriter and call WriteLine multiple times.
-
Oct 8th, 2009, 11:06 AM
#3
Thread Starter
New Member
Re: League organizer project
ummm im still abit confused could you explain to me how to use WriteAllLines?
maybe an example?
-
Oct 8th, 2009, 12:53 PM
#4
Thread Starter
New Member
Re: League organizer project
ok ive fixed it, thanks for you help anyways
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
|