86183
2022-09-09 0d999e33085c0a25c5525242748f6aa62a401159
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.dsh.app.util.pay;
 
import java.net.InetAddress;
import java.net.UnknownHostException;
 
public class PublicUtil {
 
//    public static void main(String[] args) {
//        System.out.println("本机的ip=" + PublicUtil.getIp());
//        System.out.println("地址"+getPorjectPath());
//
//        System.out.println(getPorjectPath().lastIndexOf("parent"));
//        System.out.println("地址"+getPathHome());
//    //    System.out.println(QrCodeCreateUtil.getQrCode("1235", AllEnum.QrImagesType.patientCenter));
//    }
 
    public static String getPorjectPath(){
        String nowpath = "";
        nowpath=System.getProperty("user.dir")+"\\";
        return nowpath;
    }
 
    public static String getPathHome(){
        String nowpath = "";
        nowpath=System.getProperty("user.home");
        return nowpath;
    }
 
    /**
     * 获取本机ip
     * @return
     */
    public static String getIp(){
        String ip = "";
        try {
            InetAddress inet = InetAddress.getLocalHost();
            ip = inet.getHostAddress();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        return ip;
    }
}