2012-12-01 16 views
0

我正在處理自動填寫表單,但是我沒有通過圖片上傳。圖片上傳在沒有ID或名稱的Iframe內。我想知道如果我能值添加到像.Net在沒有編號的iframe中更改值

webbrowser1.document.getelementbyid("file[]").setAttribute("Value","Url") 

WebBrowser1.Document.Window.Frames("file[]")... 

到這裏的HTML代碼(我沒有改變它ACCES)

<iframe width="250" scrolling="no" height="22" frameborder="no" marginwidth="0" marginheight="0" allowtransparency="true" border="0" src="/upload.html?v4#mdrp9c7tlgin8d038qnj6mnmi4">#document<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head></head> 
    <body> 
    <div id="button_container"><object id="SWFUpload_0" class="swfupload" width="250" height="22" data="/swfupload250beta3/swfupload.swf?wrapperbrowsercheck=0.7308926264884217&preventswfcaching=1354384013251" type="application/x-shockwave-flash"></object></div> 
    <form enctype="multipart/form-data" target="uploader" action="/upload.php" method="post"><input id="file" type="file" onchange="fileUploadStart(this);" name="file[]"></input></form> 
    </body></html></iframe> 

回答

0

使用jQuery:

$("iframe").contents().find("#file").attr("Value","Url") 
+0

這可能聽起來很愚蠢,但如何ca我將jQuery添加到我的visual basic .net項目中 – Gjavado