病毒专收员 发表于 2011-8-16 12:42:14

网页内上传文件如何用ie.udf操作呢?

本帖最后由 病毒专收员 于 2011-8-16 12:43 编辑

我想用udf自动选择需要上传的文件。我应该如何操作呢?
求解! 以下是网页源码。<td colspan="3">
    <div id="completeFileName"></div>
    <input id="file_upload" type="file" name="fileData4youhai" />
    <input type="hidden" name="attFile" id="attFile" value="">
</td>

happytc 发表于 2011-8-16 13:10:12

http://www.autoitx.com/forum.php?mod=viewthread&tid=18528&highlight=http

ghl781258 发表于 2011-8-16 21:05:27



#include <ie.au3>
_example2()


Func _example2()
        $oIE=_IECreate('http://vote.jyb.cn/votecxdw.php',1)
        With $oIE.document.parentwindow
                .execscript(FileRead("jquery-1.6.1.min.js"))               
               
                .execscript('$("input").attr("checked",true)');;;选择 甘肃省教育厅    正确        最优       
;~                 .execscript('$("input").click()');;;选择 甘肃省教育厅    正确次优

               
                .execscript('$("#name").val("姓名2")');;真实姓名
                .execscript('$("#address").val("甘肃省2")');;;;;地址
                .execscript('$("#identify").val("620302197511040651")');;身份证号码
                .execscript('$("#post").val("737102")');;邮编
               
;~                 .execscript('$("#submit").click()');;;;提交投票       
        EndWith
       
EndFunc


;~
;~ .attr("checked",true)

Func _example1()
        $oIE=_IECreate('http://vote.jyb.cn/votecxdw.php',1)
        $oForm=_IEFormGetObjByName($oIE,"votecxdw")
        _IEFormElementCheckBoxSelect($oForm,'1410');;;选择 甘肃省教育厅

        $oName=_IEFormElementGetObjByName($oForm,"name");;真实姓名
        $oAddress=_IEFormElementGetObjByName($oForm,"address");;地址
        $oIdentify=_IEFormElementGetObjByName($oForm,"identify");;身份证号码
        $oPost=_IEFormElementGetObjByName($oForm,"post");;邮编

        _IEFormElementSetValue($oName,'王某')
        _IEFormElementSetValue($oAddress,'甘肃省')
        _IEFormElementSetValue($oIdentify,'620302197511040651')
        _IEFormElementSetValue($oPost,'737100')
        ;~ _IEFormSubmit($oForm);;;;提交投票       
EndFunc

骗子 发表于 2011-8-17 14:48:11

http://www.autoitx.com/forum.php?mod=viewthread&tid=25651&rpid=318942&ordertype=0&page=1#pid318942

leibin0121 发表于 2011-8-20 08:52:19

过来学习学习
页: [1]
查看完整版本: 网页内上传文件如何用ie.udf操作呢?