Cần sử dụng thử viện
Using System.IO;
Đây là đoạn code đọc file CSV
StreamReader sr = new StreamReader(@"file.csv");
// for set encoding
// StreamReader sr = new StreamReader(@"file.csv", Encoding.GetEncoding(1250));
string strline = "";
string[] _values = null;
int x = 0;
while (!sr.EndOfStream)
{
x++;
strline = sr.ReadLine();
_values = strline.Split(';');
if (_values.Length >= 6 && _values[0].Trim().Length>0)
{
MessageBox.show(_values[1]);
}
}
sr.Close();