是否可以获取局域网中连接的设备列表?我想确定我的打印机是否已连接。谢谢你的回答
答案 0 :(得分:0)
可能的解决方案
var ping = require('ping');
var hosts = ['10.0.0.2','10.0.0.3']; <--- printer A and B addresses
hosts.forEach(function(host){
ping.sys.probe(host, function(isAlive){
var msg = isAlive ? 'host ' + host + ' is connected' : 'host ' + host + ' is not connected';
console.log(msg);
});
});