1,451
社区成员
发帖
与我相关
我的任务
分享
Private Sub Check1_Click()
If Ceck1.Value = 0 Then
Dim success As Long
success = WritePrivateProfileString("AA", "BB", "0", App.Path & "\Config.ini")
Else
Dim successa As Long
successa = WritePrivateProfileString("AA "BB "1", App.Path & "\Config.ini")
Check1.Value = 1
End If
End Sub
Private Sub Form_Load()
Dim ret As Long
Dim buff As String
buff = String(255, 0)
ret = GetPrivateProfileString("AA "BB "BB buff, 256, App.Path & "\Config.ini")
if buff = 1 Then
Check1.Value = True
End If
End sub
Public 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
Public 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 Check1_Click()
WritePrivateProfileString("AA", "BB", Ceck1.Value, App.Path & "\Config.ini")
End Sub
Private Sub Form_Load()
Dim sBuffer As String * 255,
GetPrivateProfileString "AA", "BB", vbNullString, sBuffer, Len(sBuffer), filename
Ceck1.Value = Left(sBuffer, InStr(sBuffer, vbNullChar) - 1)
End sub
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 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 Check1_Click()
Dim success As Long
If Ceck1.Value = 0 Then
success = WritePrivateProfileString("AA", "BB", "0", App.Path & "\Config.ini")
Else
success = WritePrivateProfileString("AA", "BB", "1", App.Path & "\Config.ini")
End If
End Sub
Private Sub Form_Load()
Dim ret As Long
Dim buff As String
buff = String(255, 0)
ret = GetPrivateProfileString("AA", "BB", "0", buff, 256, App.Path & "\Config.ini")
If Left(buff, 1) = "1" Then Check1.Value = True
End sub