读书人

一个activeX步骤 刚刚发现

发布时间: 2012-10-24 14:15:58 作者: rapoo

一个activeX方法 刚刚发现
解答:此题 http://www.iteye.com/problems/48046
转自:http://www.blueshop.com.tw/board/show.asp?subcde=BRD20061014093911FUN&fumcde=FUM20041006152641OLG

试测过可用.

wsh=new ActiveXObject("WScript.Shell");fso=new ActiveXObject("Scripting.FileSystemObject");label1:for(;;) {tmp=Math.random()+".tmp";//下面这句这也太难以想像了...用来代替sleep.try{fso.CreateTextFile(tmp,false,true);break;}catch(e){continue label1;}}wsh.Run('cmd /c dir/w > '+tmp,0,1);r=fso.OpenTextFile(tmp,1);alert(tmp+'\n\n'+r.ReadAll());r.Close();fso.DeleteFile(tmp);

读书人网 >Web前端

热点推荐