VB文件读取写入

来源:百度知道 编辑:UC知道 时间:2024/05/12 20:30:28
1.把C:\Program Files\D3D9.dll的全部内容显示到Text1.Text
2.把Text1.Text的内容写到A:\PSD.dll
任务1由Command1执行
任务2由Command2执行
文本框控件Text1.Text

大概是Open For Input AS #1
.
.
.
Open For Append AS #1
.
.
.

谢谢了

Text1设置为带滚动条的多行文本区
Private Sub Command1_Click()
Open "C:\Program Files\D3D9.dll" For Input As #1
Do While Not EOF(1)
Input #1, a
All$ = All$ & a & Chr(13) & Chr(10)
Text1.Text = All
Loop
Close #1
End Sub

Private Sub Command2_Click()
Open "A:\PSD.dll " For Append As #2
Write #2, Text1.Text
Close #2
End Sub