找回密码
 加入
搜索
查看: 2083|回复: 3

浏览的图片位置写入到配置文件

[复制链接]
发表于 2008-6-24 13:54:43 | 显示全部楼层 |阅读模式
#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$AForm1 = GUICreate("AForm1", 336, 169, 193, 125)
$Input1 = GUICtrlCreateInput("Input1", 40, 56, 169, 21)
$Button1 = GUICtrlCreateButton("浏览", 232, 48, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
        $nMsg=GUIGetMsg()
        Select
                Case $nMsg =  $Button1
                        GUICtrlSetData($Input1,FileOpenDialog("请选择存放图片的位置:","C:\", "图片文件(*.jpg;*.bmp)", 1 + 4 ))
                        IniWrite(@WindowsDir &"\logo.ini","logo","logo",GUICtrlRead($Input1))
ExitLoop                                        
Case $nMsg= $GUI_EVENT_CLOSE
ExitLoop
EndSelect
WEnd


logo.ini内容如下:
[logo]
logo=

[ 本帖最后由 qq342252004 于 2008-6-25 08:37 编辑 ]
发表于 2008-6-24 15:16:36 | 显示全部楼层
知道你的意思了。
把这句这么改:
IniWrite(@WindowsDir &"\logo.ini","logo","logo",GUICtrlRead($Input1))

[ 本帖最后由 顽固不化 于 2008-6-24 15:22 编辑 ]
发表于 2008-6-24 17:15:35 | 显示全部楼层
用AU3的话,抛弃以往写其他程序时的概念吧,呵呵。

如果你要把$Input1里面的字提取出来,AU3的做法是把它“读”出来,就像楼上所说的GUICtrlRead($Input1)
 楼主| 发表于 2008-6-25 08:34:59 | 显示全部楼层
谢谢了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-19 20:04 , Processed in 0.069854 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表