/// <summary> /// 读取文本文件 /// </summary> /// <param name="txtfileName">文件路径</param> private void FromTxtTodata(string txtfileName) { string txt = ""; using (StreamReader reader = new StreamReader(txtfileName,Encoding.Default )) { //循环读取所有行 //while (!reader.EndOfStream) //{ // txt += reader.ReadLine() + System.Environment.NewLine; //} txt += reader.ReadToEnd(); } MessageBox.Show("导入完成!"); }
时间: 2024-11-09 03:36:43