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

2025年02月23日 13:29
有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的数据。