(转)获取wifi的ssid
By
admin
at 2017-12-03 • 0人收藏 • 1390人看过
import console; import process.popen; subprocess = process.popen("netsh wlan show interfaces") var wlan = {}; var pattern = "\s{4}(.+)\s{6}\:(.+)"; var line = subprocess.read(); while(line){ for k,v in string.gmatch( line, pattern ){ wlan[string.trim(k)] = string.trim(v); } line = subprocess.read(); } subprocess.close(); console.printf("SSID:%s", wlan.SSID) console.log("--------------------------------") for(k,v in wlan){ console.printf("%s:%s", k, v) } console.pause(true);
转自:http://cfp.vim-cn.com/cbdGv/js
感谢群里codex分享
登录后方可回帖