vb6.0数据保存的程序的问题?

比如点一个按钮,就将text1.text中的数字保存到记事本中,比如text1.text中的数据为员工人数,则打开记事本的时候上面会显示:员工数量:****人
请高手赐教,给出程序,如果程序通过,再加50分。

Private Sub Command1_Click()
Open App.Path & "\a.txt" For Append As #1 '以追加模式打开,可追加数据,文件保存在该程序所在目录下
Print #1, "员工数量:" & Text1.Text & "人"
Close #1
End Sub
温馨提示:答案为网友推荐,仅供参考
第1个回答  2009-02-27
Option Explicit

Private Sub Command1_Click()
Dim a
a = "员工数量:" & Text1.Text

Open "c:\1.txt" For Output As #1
Print #1, a
Close

End Sub
第2个回答  2009-02-27
dim i as interger,
command 1 click,
i=i+1,
text1.text=val(i)

参考资料:vb指导用书

相似回答
大家正在搜