java监控实现方式参考

<%@   page   contentType= "text/html;charset=gb2312 "%> 
<% 
//抓取网页代码 
String   sCurrentLine; 

String   sTotalString; 

sCurrentLine= " "; 

sTotalString= " "; 

java.io.InputStream   l_urlStream; 
//此处你想要访问的页面! 
java.net.URL   l_url   =   new   java.net.URL( "http://192.168.0.10/ "); 

java.net.HttpURLConnection   l_connection   =   (java.net.HttpURLConnection)   l_url.openConnection();

l_connection.connect(); 

l_urlStream   =   l_connection.getInputStream(); 

java.io.BufferedReader   l_reader   =   new   java.io.BufferedReader(new   java.io.InputStreamReader(l_urlStream)); 

while   ((sCurrentLine   =   l_reader.readLine())   !=   null) 



sTotalString+=sCurrentLine; 



out.println(sTotalString); 

%> 

你可能感兴趣的:(java,String,null,url)