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 Any, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lplFilename As String) As Long 读: HValue = String$(20, " ") GetPrivateProfileString "YearFormula", vskey, "", HValue, Len(HValue), App.Path & "\YearFormula.Ini" 写: HValue = "0" WritePrivateProfileString "YearFormula", vskey, "0", App.Path & "\YearFormula.Ini"
open app.path & "你的文件名.ini" for input as #read input #read , phone close #read 就这么简单吧?
Public Declare Function WritePrivateProfileString Lib "Kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As Any, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lplFilename As String) As Long
读:
HValue = String$(20, " ")
GetPrivateProfileString "YearFormula", vskey, "", HValue, Len(HValue), App.Path & "\YearFormula.Ini"
写:
HValue = "0"
WritePrivateProfileString "YearFormula", vskey, "0", App.Path & "\YearFormula.Ini"
input #read , phone
close #read
就这么简单吧?