写配置文件吧
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 367, 242, 192, 114)
$Label1 = GUICtrlCreateLabel("游戏帐号:", 16, 24, 55, 17)
$Input1 = GUICtrlCreateInput("123456", 88, 22, 207, 21)
$Label2 = GUICtrlCreateLabel("游戏密码:", 16, 72, 55, 17)
$Input2 = GUICtrlCreateInput("123456", 88, 70, 207, 21,$ES_PASSWORD)
$Button1 = GUICtrlCreateButton("OK", 128, 160, 97, 33)
GUICtrlSetData($Input1, IniRead(@AppDataDir & "\" & "config.ini", "inf", "use", ""))
GUICtrlSetData($Input2, IniRead(@AppDataDir & "\" & "config.ini", "inf", "pwd", ""))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
IniWrite(@AppDataDir & "\" & "config.ini", "inf", "use",GUICtrlRead($Input1, 0))
IniWrite(@AppDataDir & "\" & "config.ini", "inf", "pwd",GUICtrlRead($Input2, 0))
EndSwitch
WEnd
如果必要还需考虑加上密码加密保存 |