2016-10-13 00:16:48 点击量:9 标签: 收藏本文
[AS3]as3获取ip地址,as3取ip的方法
- package {
- import flash.display.Sprite;
- import flash.net.InterfaceAddress;
- import flash.net.NetworkInfo;
- import flash.net.NetworkInterface;
- public class GetAddress extends Sprite {
- public function GetAddress() {
- var networkInfo:NetworkInfo = NetworkInfo.networkInfo;
- var interfaces:Vector.<NetworkInterface> = networkInfo.findInterfaces();
- if(interfaces != null ) {
- trace( "Interface count: " + interfaces.length );
- for each ( var interfaceObj:NetworkInterface in interfaces ) {
- trace( "\nname: " + interfaceObj.name );
- trace( "display name: " + interfaceObj.displayName );
- trace( "mtu: " + interfaceObj.mtu );
- trace( "active?: " + interfaceObj.active );
- trace( "parent interface: " + interfaceObj.parent );
- trace( "hardware address: " + interfaceObj.hardwareAddress );
- if( interfaceObj.subInterfaces != null ) {
- trace( "# subinterfaces: " + interfaceObj.subInterfaces.length );
- }
- trace("# addresses: " + interfaceObj.addresses.length );
- for each ( var address:InterfaceAddress in interfaceObj.addresses ) {
- trace( " cuplayer.com type: " + address.ipVersion );
- trace( " cuplayer.com address: " + address.address );
- trace( " cuplayer.com broadcast: " + address.broadcast );
- trace( " cuplayer.com prefix length: " + address.prefixLength );
- }
- }
- }
- }
- }
- }
我们是一家提供综合软件外包与弱电工程服务的技术公司。
业务涵盖定制软件、管理系统、网站、小程序、APP、系统集成、网络布线、监控安防、门禁、机房建设及长期技术维护。
公司地址:湖北省宜昌市伍家岗区东站二路6号三峡(宜昌)大数据产业园海洋馆二楼A203室