首页 > 编程语言 >aardio编程获取wifi的ssid

aardio编程获取wifi的ssid

时间:2022-09-18 11:44:06浏览次数:83  
标签:console ssid aardio wifi subprocess var wlan line string

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);

 

标签:console,ssid,aardio,wifi,subprocess,var,wlan,line,string
From: https://www.cnblogs.com/popdes/p/16704529.html

相关文章