够了.
请看如下例子
'写
Dim strFileName As String
Dim lngReturn As Long
strFileName = App.Path & "\Config.ini"
lngReturn = WritePrivateProfileString("Config", txtSection.Text, txtValue.Text, strFileName)
If lngReturn = 0 Then
MsgBox "Failed"
Else
MsgBox "Sucessed"
End If
'读
Dim strReturn As String * 2500
Dim lngReturn As Long
lngReturn = GetPrivateProfileString("Config", "name", "<NO>", strReturn, 2500, App.Path & "\config.ini")
txtSection.Text = "name"
txtValue.Text = Trim(strReturn)
请看如下例子
'写
Dim strFileName As String
Dim lngReturn As Long
strFileName = App.Path & "\Config.ini"
lngReturn = WritePrivateProfileString("Config", txtSection.Text, txtValue.Text, strFileName)
If lngReturn = 0 Then
MsgBox "Failed"
Else
MsgBox "Sucessed"
End If
'读
Dim strReturn As String * 2500
Dim lngReturn As Long
lngReturn = GetPrivateProfileString("Config", "name", "<NO>", strReturn, 2500, App.Path & "\config.ini")
txtSection.Text = "name"
txtValue.Text = Trim(strReturn)
filename 是ini文件 怎么回事?