vb中,读取txt文本文件的内容到字符串变量,怎么办?

2025-02-23 13:29:37
推荐回答(1个)
回答1:

Private Sub Command1_Click()
    Dim aa As String
    Open "c:\1.txt" For Input As #1
    Line Input #1, aa
    MsgBox aa
End Sub

上面代码变量aa的值就是读取出来txt的数据。