aardio常用语句整合(1)获取目录路径,系统信息,时间日期

admin2021-10-07  42

(一)目录路径

import console
import fsys  //文件目录磁盘操作
var $dirs = {} //定义一个目录数组
 
$dirs[1] = fsys.getCurDir() //当前目录
$dirs[2] = fsys.getSpecial(0x25/*_CSIDL_SYSTEM*/) //系统目录
$dirs[3] = fsys.getTempDir() //临时目录
$dirs[4] = fsys.getSpecial(0/*_CSIDL_DESKTOP*/) //桌面目录
$dirs[5] = fsys.getSpecial(0x26/*_CSIDL_PROGRAM_FILES*/)
 
console.varDump($dirs)
console.pause()


 
 
(二)系统信息

import console
import sys
import win  
import inet.adapter
var $syss = {} 
 
$syss[1] = sys.getStartTime() //系统启动时间
$syss[2] = sys.getComputerName() //计算机名
$syss[3] = sys.getUserName() //当前登录用户名
$syss[4],$syss[5] = win.getScreen() //屏幕宽高
 
for adptInfo in inet.adapter.each() {  //遍历网卡
    console.log(adptInfo.ipAddressList.ipAddress) //每个网卡ip地址
}
 
console.varDump($syss)
console.pause()


 (三)时间日期

import console
// time核心库
var $times = {} 
var $now = time.now() //当前时间
$times[1] = $now
$times[2] = $now.year //年
$times[3] = $now.month //月
$times[4] = $now.day    //日
$times[5] = $now.hour //时
$times[6] = $now.minute //分
$times[7] = $now.second //秒
$times[8] = $now.milliseconds //毫秒
$times[9] = $now.dayofweek //星期几
 
console.varDump($times)
console.pause()



转载请注明原文地址: http://www.aardio.net/read-208.html
最新回复(0)