서버 IP 출력

import java.net.InetAddress; public class IpDisplay { public static void main(String[] args) { // TODO Auto-generated method stub try{ InetAddress ip = InetAddress.getLocalHost(); // => 컴퓨터명/IP 출력 String source_id = ip.getHostAddress(); // => IP 출력 }catch(Exception e){ System.out.println(e.getMessage()); } }
- 광속거북이 -
'서버 IP 출력' 태그의 글 목록