if usera load usera.ini if userb load userb.ini ... 难道是这样的吗?你叫人怎么举例嘛,是不是要读写ini文件的方法呢? 如下:copy to formPrivate 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 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 Form_Load() 'KPD-Team 1999 'URL: http://www.allapi.net/ 'E-Mail: [email protected] Dim Ret As String, NC As Long 'Write the setting to the file (c:\test.ini) under ' Project1 -> Keyname WritePrivateProfileString App.Title, "KeyName", "This is the value", "c:\test.ini" 'Create a buffer Ret = String(255, 0) 'Retrieve the string NC = GetPrivateProfileString(App.Title, "KeyName", "Default", Ret, 255, "C:\test.ini") 'NC is the number of characters copied to the buffer If NC <> 0 Then Ret = Left$(Ret, NC) 'Show our string MsgBox Ret 'Delete the file Kill "c:\test.ini" End Sub
load usera.ini
if userb
load userb.ini
...
难道是这样的吗?你叫人怎么举例嘛,是不是要读写ini文件的方法呢?
如下:copy to formPrivate 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 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 Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: [email protected]
Dim Ret As String, NC As Long
'Write the setting to the file (c:\test.ini) under
' Project1 -> Keyname
WritePrivateProfileString App.Title, "KeyName", "This is the value", "c:\test.ini"
'Create a buffer
Ret = String(255, 0)
'Retrieve the string
NC = GetPrivateProfileString(App.Title, "KeyName", "Default", Ret, 255, "C:\test.ini")
'NC is the number of characters copied to the buffer
If NC <> 0 Then Ret = Left$(Ret, NC)
'Show our string
MsgBox Ret
'Delete the file
Kill "c:\test.ini"
End Sub
请搜索 ini 就可以了
存:SaveSetting app.title,"Setting","级别","1"
取:level=GetSetting(app.title,"Setting","级别","0")