弹来弹去跑马灯!

VB6 写文件


Private Sub Form_Load()

Dim nHandle As Integer
Dim FilePath As String
FilePath = "c:\wgscd\17.txt"
On Error GoTo Err
nHandle = FreeFile(44)
Open FilePath For Output As #nHandle
Print #nHandle, "wgscd"
Print #nHandle, "------------"
Print #nHandle, "ffffffffffffffffffffffff"
Close #nHandle
Exit Sub
Err:
MsgBox "" & Err.Description

End Sub


OPEN语句
Open "文件完整名.txt" for output as #1
write #1 ,Temp '要写入的变量
close #1

Open "文件完整名.txt" for input as #1
input #1,Temp '要读入的变量
close #1

posted @ 2016-02-23 14:03  wgscd  阅读(377)  评论(0编辑  收藏  举报