ã¾ãFTPã¯ã©ã¤ã¢ã³ããä½ãã«å½ãã£ã¦ãããã¯ã¼ã¯æ¥ç¶ã試ãã¦ã¿ãã
ã¨ããããã§ãIPã¢ãã¬ã¹ã¨ãã¹ãåã®å¤æã«ã¯ä»¥ä¸ã®åå空éãå¿
è¦ã
System.Net;
IPã¢ãã¬ã¹âãã¹ãåã«ã¯ Dns.GetHostEntry ã使ãã°è¯ããããã
string ipAddress = "xxx.xxx.xxx.xxx"; IPHostEntry ipHostEntry = Dns.GetHostEntry(ipAddressStr); string hostName = ipHostEntry.HostName;
éã«ãã¹ãåâIPã¢ãã¬ã¹ã®å ´å㯠Dns.GetHostAddresses ã ã
string hostName = "www.yahoo.co.jp"; IPAddress[] ipAddress = Dns.GetHostAddresses(hostName); string[] ipAddressList = new string[ipAddress.Length] for (int i = 0; i < ipAddress.Length; i++) { ipAddressList[i] = ipAddress[i].ToString(); }
ãããªæã*1ã
ã¡ãªã¿ã«ãä¸æ®µã® GetHostAddresses ã®å ´åã¯IPã¢ãã¬ã¹ãåããã¨ãã®ã¾ã¾IPã¢ãã¬ã¹ãè¿ãã®ã§ããã¹ãåã§åããããIPã¢ãã¬ã¹ã§åããããæ±ç¨çã«ä½¿ããã
ã¨ããã®ã29æ¥ã«æ¸ããã¯ããªã®ã«æ´æ°ããã¦ããªãã£ãï¼æ´æ°éä¸ã§éããã®ãï¼ï¼ã®ã§ã30æ¥ã®æã«æ¸ãã¦ã¿ããâ¦â¦æ¥ä»ã¯29æ¥ã§ãªãï¼
*1:stringã®é åã«å ¥ãã¦ããã®ã¯ç¹ã«æå³ã¯ãªããã©