Well, it would help to know exactly what you want but Ill give you a basic example.
public class MyDataObject
{
public string FirstName {get; set; }
public string LastName {get; set; }
}
We will use the above object. Then in your
Program.cs
(or where ever you want to execute your code)
using (System.IO.StreamReader sr = new System.IO.StreamReader("MyFileName"))
{
List<mydataobject> myList = new List<mydataobject>();
string[] names = sr.ReadToEnd().split('\n');
foreach (string s in names)
{
string[] values = s.split(',');
myList.Add(new MyDataObject { FirstName = values[0], LastName = values[1] });
}
}
That is the most basic way I can think of doing it?