VB 读写文本

来源:百度知道 编辑:UC知道 时间:2024/06/19 20:31:35
一个Form里面有很多的Text,还有一个Microsoft 日历控件 11.0
怎样实现,点击“command1”之后,把所有的text中的信息存到一个inf当中,并且单击日历中的日期,在text中可以显示出inf中的相应信息,如果没有,就显示出Msgbox "信息不存在"
拜托了,急用,谢谢!!一定要详细啊!

Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long '保存

Private Sub Command1_Click() '保存
Dim success As Long
success = WritePrivateProfileString("组名", "地方", Text1.Text, "c:\aa.ini")
End Sub
=======================================
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long '读

Private Sub Form_load()'读
Dim ret As Long
Dim buff As String
buff = String(255, 0)
ret = GetPrivateProfileString("组名", "地方", "", buff,