aardio桌面軟件(獲取系統信息)

import console;

console.log("程序開始執行");
var file = io.open(io._exedir+"result.txt","w");

f = io.popen("systeminfo","r");
str = f.read(-1);
f.close();


for line in string.lines(str){
     if(string.find(line,string.fromto("主機名",95001,0),0))
    {
        file.write(line);
        file.write('\n');
    }
    
     if(string.find(line,string.fromto("OS 名稱",95001,0),0))
    {
        file.write(line);
        file.write('\n');
    }
    
    
    
    
    if(string.find(line,string.fromto("安裝日期",95001,0),0))
    {
        file.write(line);
        file.write('\n');
    }
    
    if(string.find(line,string.fromto("修補程序",95001,0)))
    {
        file.write(line);
        file.write('\n');
    }


}

file.write('\n');

import sys.storage;
var devices = sys.storage.getDevices()

for(idx,devices in devices){
    var  property   = sys.storage.queryProperty(idx);
    if(!property) continue;
    
    
    file.write(string.fromto("硬盤名稱:",95001,0)+ '\t',property.productId);
    file.write('\n');
   
    file.write(string.fromto("硬盤序列號:",95001,0)+ '\t',property.serialNumber);
    file.write('\n')
    file.write('\n')
   
    
}


import inet.mac;
import inet.adapter;

file.write('\n'+string.fromto("===============網卡列表================",95001,0)+ '\n');

for adptInfo in ..inet.adapter.each() {
    
   
   
    
     file.write('\n'+string.fromto("MAC地址",95001,0)+ '\t',adptInfo.mac);
	 file.write('\n');
	 file.write('\n'+string.fromto("適配器名稱",95001,0)+ '\t',adptInfo.adapterName);
	 file.write('\n');
	 for(addr in adptInfo.ipAddressList.eachAddress()){
	 file.write('\n'+string.fromto("IP地址",95001,0)+ '\t',addr.ipAddress);
	 file.write('\n');
	 }
	  file.write('\n');
}
file.close();

console.log("程序執行完畢,請查看 " + io._exedir+"reslust.txt");
e = io.popen("notepad.exe"+ io._exedir+"result.txt","r");
e.close();



    
  




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章