找回密码
 加入
搜索
查看: 1303|回复: 2

[已解决]读取INI中的网址无法打开!

[复制链接]
发表于 2009-3-22 21:57:07 | 显示全部楼层 |阅读模式
是这样的,在GUI界面假如我有1、2、3、4、5这几个按钮,这五个按钮和按钮返回值我都是从配置文件中读取的!按钮名称显示正常,但无法执行!在RUN前使用msgbox(0,"",$wz[1])显示读取的值都是对的,无法打开网页,不知道是不是RUN这句错误!直接给地址又能运行!
代码如下:
$config="config.ini"
$name[1]=IniRead($config,"按钮","按钮名1","专线影院")
$name[2]=IniRead($config,"按钮","按钮名2","专线影院")
$name[3]=IniRead($config,"按钮","按钮名3","专线影院")
$name[4]=IniRead($config,"按钮","按钮名4","专线影院")
$name[5]=IniRead($config,"按钮","按钮名5","专线影院")
$wz[1]=IniRead($config,"网址","网址1","http://20.20.2.102/webmedia/html/index.shtml")
$wz[2]=IniRead($config,"网址","网址2","http://v.tfol.com/netbar.aspx")
$wz[3]=IniRead($config,"网址","网址3","http://192.168.0.136")
$wz[4]=IniRead($config,"网址","网址4","http://192.168.0.136")
$wz[5]=IniRead($config,"网址","网址5","http://192.168.0.136")
$Button[8] = GUICtrlCreateButton($name[1], 84, 63, 60, 30)
$Button[9] = GUICtrlCreateButton($name[2], 154, 63, 60, 30)
$Button[10] = GUICtrlCreateButton($name[3], 224, 63, 60, 30)
$Button[11] = GUICtrlCreateButton($name[4], 294, 63, 60, 30)
$Button[12] = GUICtrlCreateButton($name[5], 364, 63, 60, 30)
Case $Button[8]                                        
Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe" & $wz[1])
Case $Button[9]
Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe" & $wz[2])
Case $Button[10]
Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe" & $wz[3])
Case $Button[11]
Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe" & $wz[4])
Case $Button[12]                                        
Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe" & $wz[5])

config.ini如下:
[按钮]
按钮名1=1专线影院
按钮名2=天符宽屏
按钮名3=网吧影院
按钮名4=预留影院
按钮名5=预留影院

[网址]
网址1="http://20.20.2.102/webmedia/html/index.shtml"
网址2="http://v.tfol.com/netbar.aspx"
网址3="http://192.168.0.136"
网址4="http://192.168.0.136"
网址5="http://192.168.0.136"

[ 本帖最后由 jycel 于 2009-3-22 22:19 编辑 ]
发表于 2009-3-22 22:13:28 | 显示全部楼层
空格问题吧?


Case $Button[8]                    
Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe " & $wz[1])

iexplore.exe 后要有空格
 楼主| 发表于 2009-3-22 22:17:14 | 显示全部楼层
原帖由 zjimmy 于 2009-3-22 22:13 发表
空格问题吧?


Case $Button[8]                    
Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe " & $wz[1])

iexplore.exe 后要有空格

确实是空格问题!iexplore.exe "中间有一个空格,我没有!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-19 08:03 , Processed in 0.072571 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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