VB6.0编写记事本保存和打开代码是多少

VB6.0编写记事本保存和打开代码是多少,我要最好的,之后我复制,别添加其他东西哈。笨笨在这先谢谢大家了。

只是要打开保存的代码是吧,文本信息写在text1里,command1是打开按钮,command2是保存按钮,自己添加个common dialog控件,代码如下:Private Sub Command1_Click()
Dim a As String
cd1.CancelError = True
On Error GoTo abc
cd1.ShowOpen
Open cd1.FileName For Input As #1
Do While Not EOF(1)
Line Input #1, a
Text1.Text = a
Loop
Close #1
abc:
End Sub Private Sub Command2_Click()
cd1.CancelError = True
On Error GoTo abc
cd1.ShowSave
Open cd1.FileName For Output As #1
Print #1, Text1.Text
Close #1
abc:
End Sub
温馨提示:答案为网友推荐,仅供参考
相似回答