VB里,怎么用一个按钮在某盘生成一个txt文件,并赐予其内容。
展开全部
Private Sub Command1_Click()
Open "c:\test.txt" For Output As #1
Print #1, "Hello world."
Close #1
End Sub
Open "c:\test.txt" For Output As #1
Print #1, "Hello world."
Close #1
End Sub
追问
再问一下,怎么读取其内容?
追答
Private Sub Command2_Click()
Open "c:\test.txt" For Input As #1
Dim istr As String
Line Input #1, istr
Text1 = istr
Close #1
End Sub
赶紧结帖……
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询