第一种 不用传参数:
public String getAdminPwd() {
String path = "https://10.10.10.20:85/WebSrv/GetPwd";
//先通过地址获取流
InputStream is = NetUtils.getInputStreamByURI(path);
String pwd = null;
try {
//在通过流来获取json字符串
String info = NetUtils.getStringByInputStream(is);
//解析json
JSONObject jo = new JSONObject(info);
if (jo != null) {
String retcode = jo.getString("retcode");
if (retcode.equals("0")) {
String retmsg = jo.getString("retmsg");
pwd = retmsg;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return pwd;
}public String getAdminPwd() {