C# 读取txt

打开文件,读取所有数据,对数据进行划分


                //find the txt and read
                // 打开文件准备读取数据   
                
                StreamReader rd = File.OpenText("D:\\ak_xls_txt.txt");
                

                string restOfStream = rd.ReadToEnd();
                rd.Close();
                
//输出DataTable中保存的数组
                PetrelLogger.InfoOutputWindow(restOfStream.ToString());
                            //  restOfStream = restOfStream.Replace(""," ");
                string[] arr1 = restOfStream.Split(' ', '\n');

猜你喜欢

转载自blog.csdn.net/time_forgotten/article/details/90405281