JavaÍøÂç±à³Ì´ÓÈëÃŵ½¾«Í¨£¨2£©£º´´½¨InetAddress¶ÔÏóµÄËĸö¾²Ì¬·½·¨ - ±à³ÌÈëÃÅÍø
½á¹û£º
ComputerName/192.168.18.10 ²âÊÔ3£º´ú±í±¾»úµÄlocalhost Ö´ÐÐÈçÏÂÃüÁ java inet.MyInetAddress2 localhost ÔËÐнá¹û£º localhost/127.0.0.1 JavaÍøÂç±à³Ì´ÓÈëÃŵ½¾«Í¨£¨2£©£º´´½¨InetAddress¶ÔÏóµÄËĸö¾²Ì¬·½·¨(3)ʱ¼ä:2011-01-12¶ÔÓÚ±¾»úÀ´Ëµ£¬³ýÁË¿ÉÒÔʹÓñ¾»úÃû»òlocalhostÍ⣬»¹¿ÉÒÔÔÚhostsÎļþÖжԱ¾»ú×ö“IP/ÓòÃû”Ó³É䣨ÔÚWindows²Ù×÷ϵͳÏ£©¡£Õâ¸öÎļþÔÚC:\WINDOWS\system32\drivers\etcÖС£´ò¿ªÕâÁ½¸öÎļþÖУ¬ÔÚ×îºó¼ÓÒ»ÐÐÈçÏÂËùʾµÄ×Ö·û´®£º 192.168.18.100¡¡¡¡ www.mysite.com ²âÊÔ4£º±¾»úÓòÃûwww.mysite.com Ö´ÐÐÈçÏÂÃüÁ java inet.MyInetAddress2 www.mysite.com ÔËÐнá¹û£º www.mysite.com/192.168.18.100 getByName·½·¨³ýÁË¿ÉÒÔʹÓÃÓòÃû×÷Ϊ²ÎÊýÍ⣬Ҳ¿ÉÒÔÖ±½ÓʹÓÃIPµØÖ·×÷Ϊ²ÎÊý¡£Èç¹ûʹÓÃIPµØÖ·×÷Ϊ²ÎÊý£¬Êä³öInetAddress¶ÔÏóʱÓòÃûΪ¿Õ£¨³ý·Çµ÷ÓÃgetHostName·½·¨ºó£¬ÔÙÊä³öInetAddress¶ÔÏó¡£getHostName·½·¨½«ÔÚÏÂÃæµÄÄÚÈݽéÉÜ£©¡£¶ÁÕß¿ÉÒÔʹÓÃ129.42.58.212×÷ΪMyInetAddress2µÄÃüÁîÐвÎÊý£¨ÕâÊÇwww.ibm.comµÄIP£©£¬¿´¿´»áµÃµ½Ê²Ã´½á¹û¡£ Èý¡¢getAllByName·½·¨ ʹÓÃgetAllByName·½·¨¿ÉÒÔ´ÓDNSÉϵõ½ÓòÃû¶ÔÓ¦µÄËùÓе**P¡£Õâ¸ö·½·¨·µ»ØÒ»¸öInetAddressÀàÐ͵ÄÊý×é¡£Õâ¸ö·½·¨µÄ¶¨ÒåÈçÏ£º public static InetAddress[] getAllByName(String host) throws UnknownHostException ÓëgetByName·½·¨Ò»Ñù£¬µ±host²»´æÔÚʱ£¬getAllByNameÒ²»áÅ׳öUnknowHostExceptionÒì³££¬getAllByNameÒ²²»»áÑéÖ¤IPµØÖ·ÊÇ·ñ´æÔÚ¡£ÏÂÃæµÄ´úÂëÑÝʾÁËgetAllByNameµÄÓ÷¨£º
²âÊÔ1£ºÔ¶³ÌÖ÷»úwww.csdn.net Ö´ÐÐÈçÏÂÃüÁ java inet.MyInetAddress3 www.csdn.net ÔËÐнá¹û£º
JavaÍøÂç±à³Ì´ÓÈëÃŵ½¾«Í¨£¨2£©£º´´½¨InetAddress¶ÔÏóµÄËĸö¾²Ì¬·½·¨(4)ʱ¼ä:2011-01-12½«ÉÏÃæµÄÔËÐнá¹ûºÍÀý³Ì3-2µÄ²âÊÔ1µÄÔËÐнá¹û½øÐбȽϣ¬¿ÉÒԵóöÒ»¸ö½áÂÛ£¬getByName·½·¨·µ»Øµ**PµØÖ·¾ÍÊÇgetAllByName·½·¨·µ»ØµÄµÚÒ»¸öIPµØÖ·¡£ÊÂʵÉÏ£¬getByNameµÄÈ·ÊÇÕâÑùʵÏֵģ¬getByNameµÄʵÏÖ´úÂëÈçÏ£º
²âÊÔ2£ºÊ¹ÓÃwww.csdn.netµÄÒ»¸öIP¡¡ Ö´ÐÐÈçÏÂÃüÁ java inet.MyInetAddress3 211.100.26.122 ÔËÐнá¹û£º /211.100.26.122 ËÄ¡¢getByAddress·½·¨ Õâ¸ö·½·¨±ØÐëͨ¹ýIPµØÖ·À´´´½¨InetAddress¶ÔÏ󣬶øÇÒIPµØÖ·±ØÐëÊÇbyteÊý×éÐÎʽ¡£getByAddress·½·¨ÓÐÁ½¸öÖØÔØÐÎʽ£¬¶¨ÒåÈçÏ£º
µÚÒ»¸öÖØÔØÐÎʽֻÐèÒª´«µÝbyteÊý×éÐÎʽµÄIPµØÖ·£¬getByAddress·½·¨²¢²»ÑéÖ¤Õâ¸öIPµØÖ·ÊÇ·ñ´æÔÚ£¬Ö»ÊǼòµ¥µØ´´½¨Ò»¸öInetAddress¶ÔÏó¡£addrÊý×éµÄ³¤¶È±ØÐëÊÇ4£¨IPv |
ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»! |
- PSºÏ³É½Ì³Ì:÷¼÷ÃÑÌÎí½ûṈ̃êÖ¾
- ¼Ó¹ÌNTºÍIISµÄ°²È«(5)
- ÎÚÍаîʽ½Ó¿ÚºÍʵÏÖ·ÖÀë¼¼Êõ
- freebsd°²×°rzsz³ö´í´¦Àí
- ʹÓÃEMFʵÏÖÄ£ÐÍÇý¶¯¿ª·¢£¬µÚ1²¿·Ö£º´´½¨UMLÄ£ÐͲ¢Éú³É´úÂë - ±à³ÌÈëÃÅÍø
- Æ·ÅÆÆóÒµºÎÒÔ¼Ó¿ìCNÓòÃûÕ½ÂÔ²¼¾Ö£¿
- linuxÀïÃüÁîpkg-config¹¤¾ßµÄʹÓÃ
- CSS SpritesÍøҳͼƬÕûºÏ·½·¨
- È¥³ýÉí·ÝÖ¤ÕÕƬÍø¸ñµÄPS¼¼ÇÉ
- 17¸öÊʺϳõѧÕßµÄÖÆ×÷iPODͼ±êPhotoshop½Ì³Ì