|
|
本文由中国C#技术学习中心整理 如果你对本文有不明之处请到技术论坛讨论!
using System; using System.Net; using System.Net.Sockets; namespace GetIpByDomain { { { if( args.Length <= 0 )
{
Console.Write( " GetIpByDomain V1.0 by ∮明天去要饭 QQ:305725744 " ); Console.Write( "Usage: " ); Console.Write( " GetIpByDomain.exe <Domain> " ); Console.Write( "Example: " ); Console.Write( " GetIpByDomain.exe Www.ToEmpire.Com" ); } else { string strDomain = args[0].ToString( ); IPHostEntry hostEntry = Dns.Resolve( strDomain ); IPEndPo int ipEndPo int = new IPEndPo int(hostEntry.AddressList[0],0 ); string ipAddress = ipEndPo int.Address.ToString( ); Console.Write( ipAddress ); } } } } 我只是简单的实现一下,有兴趣的朋友可以改改Bug.
本文由中国C#技术学习中心整理 如果你对本文有不明之处请到技术论坛讨论!
|
|