国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
運(yùn)用API鉤子直接給只讀的表單上傳控件賦值
發(fā)表于 2011-10-29 10:36:24 |只看該作者 |倒序?yàn)g覽
import win.ui;
import web.form;
/*DSG{{*/
var winform = win.form(parent=...; bottom=523;scroll=1;right=744;text="演示表單上傳控件賦值";cls="DLG_WEB" )
winform.add(  )
/*}}*/

//創(chuàng)建web窗體
var wb = web.form( winform );

html =
/***
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>演示表單上傳控件賦值</title>
</head>

<body>
<form id="form1" name="form1" enctype="multipart/form-data" method="post" action="">
  <label for="upload0"></label>
  <input type="file" name="upload0" id="upload0" />
</form>
<p>文件上傳控件的值是只讀的,不能修改.<br />
這里使用AAuto中的raw.hookApi創(chuàng)建一個(gè)函數(shù)鉤子,攔截網(wǎng)頁對(duì)文件對(duì)話框的調(diào)用,<br />
并直接返回我們預(yù)設(shè)的值即可。</p>
</body>
</html>

***/

wb.write(html)
//顯示窗體
winform.show()  
wb.wait();
//等待指定網(wǎng)址,可以使用模式匹配語法
  
//導(dǎo)入函數(shù)鉤子支持庫
import raw.apiHook;

//聲明鉤子需要用到的結(jié)構(gòu)體
OPENFILENAMEW = class{
   INT structSize;
   INT hwndOwner;
   pointer instance ;
   pointer filter;
   pointer customFilter;
   INT maxCustFilter;
   INT filterIndex;
   pointer file ;
   INT maxFile;
   pointer fileTitle;
   INT maxFileTitle;
   pointer initialDir;
   pointer title;
   INT flags;
   WORD fileOffset;
   WORD fileExtension;
   pointer defExt;
   pointer lCustData;
   pointer lpfnHook;
   pointer lpTemplateName;
   pointer pvReserved;
   INT dwReserved;
   INT flagsEx;
}   
//鉤子函數(shù)
GetOpenFileNameW_Hook = function (pfn) {
   
var oldofn = raw.convert(pfn ,OPENFILENAMEW() );
    path = ..string.toUnicode(
"C:\神馬都是浮云.exe");
    ::CopyMemory(  oldofn.file,path,#path );
    winform.setTimeout(
        
function(){
            hook.unInstall();
//用完立即卸載鉤子,但是這里必須用一個(gè)異步的延時(shí)函數(shù),讓鉤子函數(shù)可以先返回再銷毀
        },1
    )   
   
return 1;
}
//安裝API鉤子
hook = raw.apiHook("comdlg32.dll", "GetOpenFileNameW", GetOpenFileNameW_Hook, "int(pointer)").install();

/** <INPUT class=text3 type=file name=upload0> **/
var ele = wb.getEle("upload0")  
ele.click()

//進(jìn)入消息循環(huán)
win.loopMessage();

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
[轉(zhuǎn)發(fā)]將Delphi的對(duì)象方法設(shè)為回調(diào)函數(shù)
抖音數(shù)據(jù)采集Frida教程,Java、Interceptor、NativePointer(Function/Callback)使用方法及示例
Go語言-逃逸分析
ASP.Net中FileUpLoad控件內(nèi)容清空
又到周末了,我們一起來研究【瀏覽器如何檢測是否安裝app】吧
單點(diǎn)登錄的post提交方式(js模擬動(dòng)態(tài)表單提交)
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服