aardio定时检测禁用网卡【切勿用作他用,仅限于自己使用,违者后果自负】
import win.ui; /*DSG{{*/ mainForm = win.form(text="wgjy";right=519;bottom=159;exmode="toolwindow";maximize=1;minimize=1;mode="popup") mainForm.add() /*}}*/ import sys.networkCards; import process.popen; jc = function(){ //尝试ping百度 var subprocess = process.popen("ping www.baidu.com -n 1"); var output = subprocess.read(-1); subprocess.close(); if(string.find(output,"TTL=")){ //禁用所有网卡 for networkCard in sys.networkCards.each(){ process.popen.cmd("netsh interface set interface "+networkCard.netConnectionId+" disabled"); } //提示网卡已被禁用 //写日志 import fsys.ini; ini = fsys.ini("net.log"); if(null==ini.read("tab","num")){ //违规时间初始化 ini.write("tab","connect","时间"); //违规次数初始化 ini.write("tab","num","0"); } if(null!=ini.read("tab","num")){ num = ini.read("tab","num")+1; ini.write("tab","num",num); ini.write("tab","tips"+num,"您已违规"+num+"次"); ini.write("tab","dat"+num,time.now().local(true)); //用多线程或打开其他窗口进行提示 //自行增加 } } } //定时执行 mainForm.setInterval( function(){ jc(); },3000 ) //mainForm.show(); return win.loopMessage();