My problem is to save and read the file.
Can u suggest the best way to save the data(mostly numbers) from various forms into a data file (can be .txt, .dat etc) and then read a specific data from the file...
For example..
I write:
Data 1 Data 2 Data 3
when in the equation need data 3, it can read it and pick data 3 only...
What I'm thinking of right now is to save data per line,
For example:
Data 1
Data 2
Data 3
So when I need data 3, I just need to pick data from 3rd line to pick data 3.
How to do it?
I've researched a little and found this
string[] Lines = File.ReadAllLines("filename.txt");
Lines[1] = "second line new value";
File.WriteAllLines("filename.txt");
from what I get, that command will write data on second line at filename.txt. If its true, how to read it?
Is there a better way to do it?
I don't mind if u just paste a url for me to read or directly post a sample code.