zoukankan      html  css  js  c++  java
  • Java编程实现获取本机IP和计算机名的功能

    版权声明:本文为博主原创文章。未经博主同意不得转载。

    https://blog.csdn.net/wangshuxuncom/article/details/35990847

    import java.net.InetAddress;
    import java.net.UnknownHostException;
    
    public class Test {
    
    	public static void main(String[] args) {
    		try {
    			InetAddress inetAddress = InetAddress.getLocalHost();
    			System.out.println("本机IP:"	+ inetAddress.getHostAddress().toString());
    			System.out.println("本机名称:" + inetAddress.getHostName().toString());
    		} catch (UnknownHostException e) {
    			e.printStackTrace();
    		}
    	}
    }
查看全文
  • 相关阅读:
    Oracle -- Create Tablespace
    EntityFramework-DBFirst-重新生成后写的验证消失(解决办法)
    UILocalNotification本地通知
    属性观察者willSet与didSet
    常用后台frame框架
    Windows常用CMD命令
    常用的格式符与转义字符
    Windows操作系统常用快捷键
    Mac操作系统常用快捷键
    srp render queue 失效
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10745166.html
  • Copyright © 2011-2022 走看看