获取用户操作系统信息
flash.system.Capabilitie类的os属性
操作系统 | 值 |
---|---|
Windows 10 | “Windows 10” |
Windows 8 | “Windows 8” |
Windows 7 | “Windows 7” |
Windows Vista | “Windows Vista” |
Windows Server 2012 | “Windows Server 2012” |
Windows Server 2008 R2 | “Windows Server 2008 R2” |
Windows Server 2008 | “Windows Server 2008” |
Windows Home Server | “Windows Home Server” |
Windows Server 2003 R2 | “Windows Server 2003 R2” |
Windows Server 2003 | “Windows Server 2003” |
Windows XP 64 | “Windows Server XP 64” |
Windows XP | “Windows XP” |
Windows 98 | “Windows 98” |
Windows 95 | “Windows 95” |
Windows NT | “Windows NT” |
Windows 2000 | “Windows 2000” |
Windows ME | “Windows ME” |
Windows CE | “Windows CE” |
Windows SmartPhone | “Windows SmartPhone” |
Windows PocketPC | “Windows PocketPC” |
Windows CEPC | “Windows CEPC” |
Windows Mobile | “Windows Mobile” |
Mac OS | “Mac OS X.Y.Z”(其中 X.Y.Z 为版本号,例如 “Mac OS 10.5.2”) |
Linux | “Linux”(Flash Player 连接 Linux 版本,如 “Linux 2.6.15-1.2054_FC5smp” |
iPhone OS 4.1 | “iPhone3,1” |
读取硬件网卡MAC地址与IP地址信息
import flash.net.NetworkInfo;
import flash.net.InterfaceAddress;
var netWorkVec:Vector.<NetworkInterface > = NetworkInfo.networkInfo.findInterfaces();
trace("--------------------------")
for (var i:* in netWorkVec) {
trace("网络连接名称:"+netWorkVec[i].displayName);
trace("MAC网卡地址:"+netWorkVec[i].hardwareAddress);
var addressVec:Vector.<InterfaceAddress> = new Vector.<InterfaceAddress>();
addressVec = netWorkVec[0].addresses;
for (var j:* in addressVec) {
trace("网络IP地址:"+addressVec[j].address);
}
trace("--------------------------")
}
这套代码会遍历出所有网络连接,要取得实际的网卡地址还需要过滤一下。
要判断InterfaceAddress的两个属性:其一,active;其二,hardwareAddress。
active要为true;hardwareAddress要不能为空字符串。
说明:虚拟网卡等会存在列表中。