vb dat读写

来源:百度知道 编辑:UC知道 时间:2024/06/15 15:00:12
Private Sub Command1_Click()
Dim t As String
Open App.Path & "\1.dat" For Binary As #1
Get #1, , t
Close #1
Text1.Text = t
End Sub

Private Sub Form_Load()
Open App.Path & "\1.dat" For Binary As #1
Put #1, , 12345
Close #1
End Sub

点了按纽以后……textbox一片空白……请指教

Private Sub Command1_Click()
Dim t As String
Open App.Path & "\1.dat" For Binary As #1
Get #1, , t
Text1.Text = Text1.Text & t
Close #1
End Sub

好像是这样的吧!~

Private Sub Command1_Click()
text1=""
Dim t As String
Open App.Path & "\1.dat" For input As #1
do while not eof(1)
line input #1, t
text1=text1 & t
loop
Close #1

End Sub

Private Sub Command1_Click()

Dim t As String
Open App.Path & "\1.dat" For Binary As #1
t = Input(LOF(1), #1)
Close #1
Text1.Text = t

End Sub

Private Sub Form_Load()

Open App.Path & "\1.dat" For Binary As #1
Put #1, , "12345"
Close #1

End Sub

祝好运!