using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Data;
using System.IO;
using System.Reflection;
using System.ComponentModel;
namespace Neusoft.Core.Neusoft.Core.Utils
{
///
/// //读CSV文件类,读取指定的CSV文件,可以导出DataTable..........add by chujianqin
///
public class CsvStreamReader
{
private ArrayList rowAL; //行链表,CSV文件的每一行就是一个链
private string fileName; //文件名
public DataTable csvDT = new DataTable();
private Encoding encoding; //编码
public DataTable table = new DataTable();
bool IsFirst = true;
List arry = new List();
public CsvStreamReader()
{
this.rowAL = new ArrayList();
this.fileName = "";
this.encoding = Encoding.Default;
}
///
///
///
/// 文件名,包括文件路径
public CsvStreamReader(string fileName)
{
this.rowAL = new ArrayList();
this.fileName = fileName;
this.encoding = Encoding.Default;
LoadCsvFile();
DataView dataView = csvDT.DefaultView;
dataView.Sort = "ID desc";
csvDT = dataView.ToTable();
}
///
///
///
/// 文件名,包括文件路径
/// 文件编码
public CsvStreamReader(string fileName, Encoding encoding)
{
this.rowAL = new ArrayList();
this.fileName = fileName;
this.encoding = encoding;