vb2010怎么读写txt文件?
展开全部
Dim name As String = ""
Dim age As Integer
name = InputBox("请输入姓名")
age = InputBox("请输入年龄")
FileOpen(1, "d:\信息.txt", OpenMode.Append)
WriteLine(1, name, age)
FileClose(1)
FileOpen(1, "d:\信息.txt", OpenMode.Input)
Dim h As String
Dim j As String
Dim f As String
f = ""
h = ""
j = ""
While EOF(1) = False
f = LineInput(1) & vbCrLf & f
End While
FileClose(1)
MsgBox("姓名" & " " & "年龄" & vbCrLf & f)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询