日期:2014-05-18 浏览次数:20799 次
string str; using (FileStream fs = File.OpenRead(@"C:\Documents and Settings\wtyeh\桌面\1.txt")) { byte[] by=new byte[fs.Length]; fs.Read(by, 0, Convert.ToInt32(fs.Length)); str = UnicodeEncoding.Default.GetString(by); } string[] s = str.Split(new string[] { "\r\n" },StringSplitOptions.None); foreach (string ss in s) { //对每条数据进行操作 }
------解决方案--------------------