Quote (Pat_Man @ Jul 30 2013 07:57pm)
Yes, I was going to have to capture the new data and either append or overwrite it on the file.
Yet I have no idea how to do this, because im a complete nobsauce.
I don't really know C# all that well, so I probably can't help you out as much as some of the guys here can.
However.. I can tell you that it's writing 01234567 because you've setup a loop that iterates 8 times and writes the loops current iteration. And it's putting it on a the next row down because you've also appended a tab character to the file 8x as well.
Like you said, you'll need to capture the new data you typed in, and then write that.
How'd you go about capturing the data, I don't know. There should be a member function for the field object, like getText(), that will return the text you typed in.
Once you've managed to capture the field text, you'll be able to write that to the file.
Here's a link that explains how to write to files:
http://msdn.microsoft.com/en-us/library/vstudio/8bh11f1k.aspxHere's some sloppy pseudo code, but I think it gets the point across.
Code
button1_click()
{
open file("//path//to//file");
text = field.getText();
file.write(text);
file.close();
}
Hopefully that makes sense...