vb,vbs写入txt数据

vb:

1)

Dim i As Integer
Private Sub command1_click()
i = i + 1
Open "c:\1.txt" For Append As #1
Print #1, i
Close #1
End Sub
2)Open "1.txt" For Output As #1   //output是覆盖   Append是追加


For i = 1 To 10
Print #1, Trim(i)
Next i
Close #1
VBS:
set fso=createobject("scripting.filesystemobject")
set f=fso.opentextfile("d:\a.txt",2,true):f.write "写入内容":f.close
 
  

你可能感兴趣的:(软件应用类(专业))