Windows forms program
How to write a windows forms program that will allow the user to open and load the records of a comma delimited file?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Shakti Singh DulawatRank #668 · 3.6K reputationPosted May 10, 2016, 1:19 AM EDT
var lines = File.ReadAllLines(pathToFile);Bhuvanesh MohankumarRank #310 · 8.1K reputationPosted May 10, 2016, 4:35 AM EDT
Hi Sipho,
using System.IO;
static void Main(string[] args) listA = new List(); listB = new List();
{
var reader = new StreamReader(File.OpenRead(@"C:\test.csv"));
List
List
while (!reader.EndOfStream)
{
var line = reader.ReadLine();
var values = line.Split(';');
listA.Add(values[0]);
listB.Add(values[1]);
}
}
Mark as answer, if helpful.