日期:2014-05-17  浏览次数:20806 次

C# 是否可以用C#winform程序,调用别的网站的doPostBack方法?
本帖最后由 nm8222157 于 2013-12-16 10:35:03 编辑
我想用winform调用网页上的一个doPostBack,方法代码是:

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>



调用时的代码是 :

<td>C370895204520131213163009</td><td>发票.pdf</td><td>2013/12/13 16:30:42</td><td>&nbsp;</td><td align="center"> 
                 <a id="GridView1_View_0" href="javascript:__doPostBack(&#39;GridView1$ctl02$View&#39;,&#39;&#39;)">查看</a>
</td>


------解决方案--------------------

呵呵&…………………………………………………………………………………………