開發平台(Platform): (Ex: Win10, Linux, ...) win10 編譯器(Ex: GCC, clang, VC++...)+目標環境 (跟開發平台不同的話需列出) viusal studio 內的c# 問題(Question): 換檔案讀取後就無法正常運作 餵入的資料(Input): 1.txt內容 1234567where is my friend? sorry 你沒朋友 2.txt內容 7654321where do you live sorry i cannot tell you 預期的正確結果(Expected Output): 1.txt 1234567where is my friend 2.txt 7654321where do you live 錯誤結果(Wrong Output): 1.txt結果是成功的 2.txt結果 7654321 i tell you 程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔) using (StreamReader sr = newStreamReader(@"C:\Users\Administrator\Desktop.1.tx t")) while (sr.Peek() != -1) { string line = sr.ReadLine(); foreach (var ch in line) { string[] words = line.Split(); string together = string.Join(" ", words); string x = sr.ReadLine(); if (x == "sorry") { break; } Console.WriteLine(x); } } Console.Read(); 補充說明(Supplement): 想請問版上的高手們應該如何修改呢?謝謝