VB超简单代码

来源:百度知道 编辑:UC知道 时间:2024/06/03 23:46:05
就是输入123到Form1 第二次启动还有123 怎么保存 最好不是保存在txt里面

超简单的:
’从注册表取上次的数据。
Private Sub Form_Load()
text1.Text = GetSetting("Myapp", "ConFig", "ScorceFile")
end Sub
'关闭时保存到注册表先:
Private Sub Form_Unload(Cancel As Integer)
Call SaveSetting("Myapp", "ConFig", "ScorceFile", text1.Text)
end sub
****************************************给分哦,祝你进步!

’从注册表取上次的数据。
Private Sub Form_Load()
text1.Text = GetSetting("Myapp", "ConFig", "ScorceFile")
end Sub
'关闭时保存到注册表先:
Private Sub Form_Unload(Cancel As Integer)
Call SaveSetting("Myapp", "ConFig", "ScorceFile", text1.Text)
end sub
'数据库(很麻烦)

抄别人那个…………我GAN NI NIANG

数据如果是重要的,保存在注册表不够好了.数据容易丢失。
建议以文件的方式保存。