如何用VB把一个txt文件中的数据经运算后存到另一个txt文件中

2025-05-04 22:31:43
推荐回答(1个)
回答1:

Private Sub Command1_Click()
Dim a As String
Open App.Path & "A.txt" For Input As #1
Open App.Path & "B.txt" For Output As #2
While Not EOF(1)
Line Input #1, a
Print #2, Val(a) * 2 + 1
Wend
Close #1
Close #2
End Sub