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:
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;