return dt;
}
//读取记事本数据
public DataTable ReadTXT(string dirTXT)
{
StreamReader objReader = new StreamReader(dirTXT);
System.Data.DataTable dt = new System.Data.DataTable();
dt.Columns.Add("DN", System.Type.GetType("System.String"));
string sLine = "";
while (sLine != null)
{
sLine = objReader.ReadLine();
if (sLine != null && !sLine.Equals(""))
{
DataRow dr = dt.NewRow();
dr[0] = sLine;
dt.Rows.Add(dr);
}
}
objReader.Close();
return dt;
}
您可能感兴趣的文章: