赞
踩
c# 打开并一行一行对取文件
openFileDialog1.ShowDialog();
System.Diagnostics.Trace.WriteLine(openFileDialog1.FileName.ToString());
using (StreamReader sr = new StreamReader(openFileDialog1.FileName.ToString()))
{
string str = "";
int i = 0;
str = sr.ReadLine().Trim();
i = str.Length;
if (i != 0)
{
System.Diagnostics.Trace.WriteLine(str.ToString());
}
else
{
System.Diagnostics.Trace.WriteLine("没有数据");
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。