本帖最后由 leaive 于 2010-10-18 13:55 编辑
要实现的目的:
1,判断程序所在目录$wxkfoder是否存在ini文件,否则创建
2,获取变量并写入ini
3,读取ini中的变量写入$wxkfoder
问题:写入/读取ini时出错,求助.....Dim $wxkfoder,$inidata
$inifile = (@ScriptDir & "\wxnoad.ini")
If FileExists (@ScriptFullPath & "wxnoad.ini") -1 Then
IniWriteSection($inifile,"配置信息",$inidata)
ElseIf FileExists (@ScriptFullPath & "\wxnoad.ini") Then
IniRead(@ScriptDir & "\wxnoad.ini","配置信息","程序目录")
ConsoleWrite($wxkfoder)
Else
$wxkfoder = FileSelectFolder("请选择服务端所在目录.", "")
If FileExists ($wxkfoder & "\wxdbserv.exe") -1 Then
MsgBox(0,"目录不正确","请重新选择")
ElseIf FileExists ($wxkfoder & "\WxDBServ.exe") Then
MsgBox(0,"tips","目录正确")
ConsoleWrite($wxkfoder)
IniWrite($inifile,"配置信息","程序目录","$wxkfoder")
MsgBox(0,"tips","写入ok")
EndIf
|