Private Sub Form_Load()'启动时加载
If Dir(App.Path & "\date.txt") <> "" Then
f% = FreeFile
Open App.Path & "\date.txt" For Input As f
Do Until EOF(f)
Line Input #f, s
List1.AddItem s
Loop
close #f
End If
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
f% = FreeFile'退出时保存
Open App.Path & "\date.txt" For Output As f
For i = 0 To List1.ListCount - 1
Print #f, List1.List(i)
Next
close #f
End Sub
用open...for...as...语句保存到文件
程序里在formload里写死不就行了吗?