✔ 最佳答案
Imports System.IO
'...
Dim fileEntries As String() = Directory.GetFiles("C:\novel", "*.txt")
Dim fileName As String
Dim buffer = "End of chapter"
Dim sw As New IO.StreamWriter(fileName, True)
For Each fileName In fileEntries
Try
sw.writeline(buffer)
sw.close()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Next
'...
'沒試過,用前請先隨意拿個不要的txt檔作測試