VB高手进来看看

2025-05-18 13:46:48
推荐回答(3个)
回答1:

新建一个按钮Command1
代码:
Private Sub Command1_Click()
Opten "C:\123.TXT" For OutPut As #1 '打开文件
Print #1,Text1.text '写入
Close #1 ’关闭文件
End Sub

回答2:

Private Sub Command1_Click()
Dim fFile As Integer
fFile = FreeFile
Open "c:\123.txt" For Append As fFile
Print #fFile, "-" & Text1.Text
Close fFile
End Sub

回答3:

Private Sub Command1_Click()
Open "C:\123.txt" For Output As #1
Print #1, Text1.Text
Close #1
End Sub

'画面添加command1 text1