using (StreamReader sr = File.OpenText("Data/ComboDataList.txt")) { _userData = new List<UserData>(); //内容を一行ずつ読み込む while (sr.Peek() > -1) { var TEST = sr.ReadLine(); string[] words = TEST.Split(','); _userData.Add(new UserData() { Data = words[0], View = words[1] }); } userDataBindingSource.DataSource = _userData; }; }
using (StreamReader sr = File.OpenText("Data/ComboDataList.txt")) { _userData = new List<UserData>(); //内容を一行ずつ読み込む while (sr.Peek() > -1) { var TEST= sr.ReadLine(); string[] words = TEST.Split(','); _userData.Add(new UserData() { Title = words[0], Data = words[1] }); }