- '引用读写ini
- PrivateDeclareFunctionGetPrivateProfileStringLib"kernel32"Alias"GetPrivateProfileStringA"(ByVallpApplicationNameAsString,ByVallpKeyNameAsString,ByVallpDefaultAsString,ByVallpReturnedStringAsString,ByValnSizeAsInt32,ByVallpFileNameAsString)AsInt32
- PrivateDeclareFunctionWritePrivateProfileStringLib"kernel32"Alias"WritePrivateProfileStringA"(ByVallpApplicationNameAsString,ByVallpStringAsString,ByVallpFileNameAsString)AsInt32
- PublicFunctionGetINI(ByValSectionAsString,ByValAppNameAsString,ByValFileNameAsString)AsString
- DimStrAsString=LSet(Str,256)
- GetPrivateProfileString(Section,AppName,lpDefault,Str,Len(Str),FileName)
- ReturnMicrosoft.VisualBasic.Left(Str,InStr(Str,Chr(0))-1)
- EndFunction
- PublicFunctionWriteINI(ByValSectionAsString,ByValFileNameAsString)AsLong
- WriteINI=WritePrivateProfileString(Section,FileName)
- EndFunction
- DimTempStrAsString=Application.StartupPath&"/Option.ini"'路径
- ValuesStr=GetINI("runoption","refresh","",TempStr)'读ini
- WriteINI("runoption","autoin",TempValues,TempStr)’写ini