VB保存txt

来源:百度知道 编辑:UC知道 时间:2024/06/10 23:36:05
如何把text1中的内容保存到C:\1.txt中的第三行(替换原有的第三行),总行数大于3行

Private Sub Command1_Click()
Open file1 For Input As 1
Open file2 For output As 2
For i = 1 To 2
Line Input #1, tmp
Print #2, tmp
Next i
Print #2, 第三行内容
Do Until EOF(1)
Line Input #1, tmp
Print #2, tmp
Loop
Close 1, 2
Name file2 As file1

End Sub

分太少