11-09-20, 08:44 AM
يمكنك استخدام StreamReader لقراءة الملف و StreamWriter للكتابة في ملف جديد :
True في StreamWriter(outFilePath, True) تعني انه سيضيف الى نهاية الملف
كود :
Dim file1Path As String = "E:\1.txt"
Dim file1 As String
Using reader As New IO.StreamReader(file1Path)
file1 = reader.ReadToEnd
End Using
Dim file2Path As String = "E:\2.txt"
Dim file2 As String
Using reader As New IO.StreamReader(file2Path)
file2 = reader.ReadToEnd
End Using
Dim outFilePath As String = "E:\out.txt"
Using writer As New IO.StreamWriter(outFilePath, True)
writer.Write(file1)
writer.Write(file2)
End UsingTrue في StreamWriter(outFilePath, True) تعني انه سيضيف الى نهاية الملف

