Finding the IP address in Adobe AIR

2019-06-05 00:16发布

How to know the IP address of the system in which the AIR application is currently running, Or how to restrict the usage of AIR application for a particular country?

1条回答
淡お忘
2楼-- · 2019-06-05 00:35

Please try the following code, it works for me.

import flash.net.InterfaceAddress;
import flash.net.NetworkInterface;

var netInterfaces:Vector.<NetworkInterface> = NetworkInfo.networkInfo.findInterfaces();
var addresses:Vector.<InterfaceAddress> = netInterfaces[0].addresses;
ipAddress = addresses[0].address;
查看更多
登录 后发表回答