Hello, I have a text file that I need to convert the list of numbers into integers. So far I'm just reading it in real basic(I've tried a lot of code before I came here, I usually do, but I'm still a noob/boob). I have two columns rating and frequency, each with about 5 numbers below them. I can read the file into a list box just fine into the windows forms using:
private void ReadButton1_Click(object sender, EventArgs e)
{
List<string> myList = new List<string>();
myList = System.IO.File.ReadLines("f:\\numbers.txt").ToList();
this.listBox1.DataSource = myList;
}
How do I convert the numbers in the text to ints? It seemed easy at first, but it isn't when I don't know how(I've seen some discussions on how to do this in a console, but that gave me more problems than I knew what to do with)....all I know is I need to use the streamreader and split method to do this, then convert. Any help is appreciated. Hopefully one day I won't be the one asking questions ALL the time and I can start providing help to someone like me.