中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-03 20:32
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [已解决]寻求获取file(i).value数值的 VBS 脚本 查看 621 回复 2
楼 主 [已解决]寻求获取file(i).value数值的 VBS 脚本 发表于 2007-03-25 02:12 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
积分 3,687
发帖 1,467
注册 2005-08-08 12:00
20年会员
UID 44210
状态 离线
复选框:
<input type="checkbox" id="file1" name="file1" value="FileName1">
<input type="checkbox" id="file2" name="file2" value="FileName2">
<input type="checkbox" id="file3" name="file3" value="FileName3">
<input type="checkbox" id="file4" name="file4" value="FileName4">


要获取选中的复选框数值可用:
if file1.checked then MsgBox file1.value
if file2.checked then MsgBox file2.value
if file3.checked then MsgBox file3.value
if file4.checked then MsgBox file4.value
获取

但是如果数量大,if脚本就要跟着一样的数量(复选框是根据文件多少自动调整的)
试过
for i = 1 to Num
if file(i).checked then MsgBox file(i).value)
next
方式无效,在网上没找到何时的方法解决,询问有没有VBS方面的高手能解决?

[ Last edited by zh159 on 2007-3-24 at 04:32 PM ]
2 发表于 2007-03-25 04:49 ·  中国 四川 成都 教育网
铂金会员
★★★★
积分 7,493
发帖 2,672
注册 2005-09-02 00:00
20年会员
UID 42173
性别 男
状态 离线
提示:eval()

例如:

i=1
msgbox eval("file" & i & ".checked")

[ Last edited by electronixtar on 2007-3-25 at 05:08 AM ]
本帖最近评分记录 (共 1 条) 点击查看详情
评分人分数时间
zh159 +15 2007-03-25 05:30

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
3 发表于 2007-03-25 05:31 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
积分 3,687
发帖 1,467
注册 2005-08-08 12:00
20年会员
UID 44210
状态 离线
Originally posted by electronixtar at 2007-3-24 15:49:
提示:eval()

例如:

i=1
msgbox eval("file" & i & ".checked")


搞定,多谢了
论坛跳转: