[轉]獲取手機型號、IP(有待驗證)

獲取手機型號、IP(有待驗證) 
Java代碼 
<%   
        String type = request.getHeader("User-Agent");   
        String ip = request.getHeader("X-Forward-For");   
        String pcIP = request.getRemoteAddr();   
        String number1 = request.getHeader("X-Up-Calling-Line-Id");   
        String number2 = request.getHeader("x-up-calling-line-id");   
           
        System.out.println("\n");   
        System.out.println("型號:" + type);   
        System.out.println("---------------------");   
        System.out.println("IP:" + ip);   
        System.out.println("---------------------");   
        System.out.println("PC IP:" + pcIP);   
        System.out.println("---------------------");   
        System.out.println("號1:" + number1);   
        System.out.println("---------------------");   
        System.out.println("號2:" + number2);   
        System.out.println("---------------------");           
     %>  

<% 
String type = request.getHeader("User-Agent"); 
String ip = request.getHeader("X-Forward-For"); 
String pcIP = request.getRemoteAddr(); 
String number1 = request.getHeader("X-Up-Calling-Line-Id"); 
String number2 = request.getHeader("x-up-calling-line-id"); 

System.out.println("\n"); 
System.out.println("型號:" + type); 
System.out.println("---------------------"); 
System.out.println("IP:" + ip); 
System.out.println("---------------------"); 
System.out.println("PC IP:" + pcIP); 
System.out.println("---------------------"); 
System.out.println("號1:" + number1); 
System.out.println("---------------------"); 
System.out.println("號2:" + number2); 
System.out.println("---------------------");	
%>



聽說已經不能得到手機號碼,被移動屏蔽,獲得移動批准的SP才能夠得到。 



如何判斷訪問者是來自哪一個瀏覽器或者移動電話? 
    能夠經過檢查HTTP_USER_AGENT標籤來判斷。例如試着使用Microsoft Internet Explorer訪問一個站點的時候,HTTP_USER_AGENT將返回:Mozilla/4.0 (compatible;MSIE 5.0; Windows 98);在一樣的狀況下使用Nokia 7110訪問這個站點,HTTP_USER_AGENT就會是:Nokia7110/1.0(04.73)。據此能夠判斷用戶代理是什麼類型的。 
相關文章
相關標籤/搜索