獲取裝置相關資訊工具包

2021-08-15 21:21:53 字數 2600 閱讀 4753

拿走不謝

public

public

static

void

main(string args) }

/**

* 根據位址獲取經緯度

*@return

*/public

static mapgetlatandlngbyaddress() catch (unsupportedencodingexception e1)

string url = string.format(

""+"ak=你獲取的秘鑰&output=json&address=%s",

// 進行轉碼

try catch (malformedurlexception e)

try ,\"precise\""));

lng = data.substring(data.indexof("\"lng\":") + ("\"lng\":").length(), data.indexof(",\"lat\""));

}insr.close();

}} catch (ioexception e)

mapmap = new hashmap();

map.put("lat", double.valueof(lat));

map.put("lng", double.valueof(lng));

return map;

}/**

* 獲取本機訪問外網的真實ip 和 運營商 和 所在省市

* *@return

*/public

static string getpublicipandoperator()

system.out.println(ip);

operator = ip.split(" ")[2];

address = ip.split(" ")[1].split(":")[1];

// 從文字串過濾出ip,用正規表示式將非數字和.替換成空串""

ip = ip.replaceall("[^0-9.]", "");

} catch (ioexception e)

return ip + "," + operator+","+address;

}/**

* 獲取裝置螢幕的寬度和高度

* *@return

*/public

static string getscreensize()

/*** 獲取當前時間

* *@return

*/public

static string getcurrenttime()

/*** 檢測使用者使用的瀏覽器型別,版本號以及系統類別

ssh相關原理及工具包

ssh相對於telnet等協議的優點在於安全性,ssh使用了非對稱加密來確保安全性。登入步驟 遠端server收到client端使用者的登入請求,server把自己的公鑰發給使用者。client使用這個公鑰,將密碼進行加密。client將加密的密碼傳送給server端。遠端server用自己的私鑰,...

拷貝工具包

常用工具包封裝.懶得引各種雜七八的包,輕量級包.cglib還是需要的 scope provided 1.0.0 copyutils beancopier封裝.提供簡單的單一複製與list複製.不支援自定義建構函式的類的複製.abc abc copyutil copysigle abc class o...

iOS獲得裝置相關資訊,獲取app相關資訊

裝置所有者名稱 device.name 裝置所有者名稱 nslog 裝置類別 device.model 裝置leibie nslog 本地化版本 device.localizedmodel 本地化版本 nslog 當前系統版本 device.systemversion 當期版本 nslog 當前系統...