詳情請入內,呵呵~~!!

using System.IO;

FileStream fs = new FileStream("data.txt", FileMode.Open);
StreamReader sr = new StreamReader(fs, Encoding.Default);
string str = "";

//讀取文字檔裡的每一列
//直到沒有文字就停下來
while( (str = sr.ReadLine()) != null)
{
      //若為空白列,則不顯示
      if(str != "") textBox.Text += str + "\r\n";
}

以上若有錯誤,可進行告知與糾正,謝謝~~!

arrow
arrow
    全站熱搜

    dreamtails 發表在 痞客邦 留言(2) 人氣()