Option Explicit Private Sub Command1_Click() Dim file_1, file_2 As String '文件名 file_1 = "f:123.txt" file_2 = "f:456.txt" Dim abc As String '所读取的文本文件的所有内容 Dim xyz As String '在循环中存放每行的内容 Open file_1 For Input As #1 Open file_2 For Append As #2 Do While Not EOF(1) '循环直至文件尾 Line Input #1, xyz '每次读取一行存放在xyz变量 abc = abc & xyz & vbCrLf 'vbCrLf=Chr(13) + Chr(10) 回车符+换行符 Loop Print abc '打印 Write #2, Now & vbCrLf & abc Close Name "f:123.txt" As "f:/123/789.txt" '修改123.txt的路径和文件名 End Sub 相关文章: VB操作EXCEL文件大全 2021-11-02 VB对GridView的一些操作 2022-12-23 python中对文件、文件夹的操作 2021-06-03 [VB]VB操作Execl 2021-10-04 Windowsforms 中对文件操作 2022-12-23 iOS中对文件的操作 - cynthia116 2021-10-20