用什么方法能将这段HTML里面指定的字符串提取出来?[已解决]
本帖最后由 viplight 于 2011-7-29 04:15 编辑<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>ASDF</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gbk">
<SCRIPT language=javascript>
var sessionid="13117.932";
var webTimeout = 1000*60*60;
var curTime = 0;
var user_permission="";
var urlcur="";
if(!sessionid || !user_permission)
window.top.location.replace("/");
if(isNaN(webTimeout))
webTimeout=1000*60*10;
function resetURL()
{
setTimeout(function(){urlcur="";},3000);
}
function refreshTimeout() {
curTime = 0;
}
function refreshTimer() {
curTime += 5000;
if(curTime >= webTimeout){
window.top.location.replace("/");
}else {
setTimeout(refreshTimer, 5000);
}
}
setTimeout(refreshTimer, 5000);
</SCRIPT>
</HEAD><FRAMESET border=0 frameSpacing=0 frameBorder=no cols=*,1020,*><FRAME id=left_bj name=left_bj marginWidth=0 src="left_bj.htm" noResize scrolling=no marginhight="0"><FRAMESET border=0 frameSpacing=0 rows=97,* frameBorder=no><FRAME id=logo name=logo marginWidth=0 src="top.htm?SESSIONID=13117.932" scrolling=no marginhight="0"><FRAMESET border=0 frameSpacing=0 frameBorder=no cols=166,*><FRAME id=menu name=menu marginWidth=0 src="menu.htm?SESSIONID=13117.932" noResize marginhight="0"><FRAME id=config name=config marginWidth=0 src="home.htm?SESSIONID=13117.932" noResize marginhight="0"></FRAMESET></FRAMESET><FRAME id=right_bj name=right_bj marginWidth=0 src="right_bj.htm" noResize scrolling=no marginhight="0"></FRAMESET></HTML>
我先要提取的是var sessionid=后面的“13117.932”,<这里的数字是随机的<这个问题解决了,感谢ipxxhttp://www.autoitx.com/images/common/back.gif>
第二个HTML 无法适用浏览起打开,不知道有没有其它办法获取里面WAN1_IPADDRWAN2_IPADDRWAN3 _IPADDR WAN4_IPADDR 对应的ip<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<link href="css/nmn_common.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="javascript/nmn_common.js"></script>
<script language="javascript">
if(window.top.refreshTimeout){
window.top.refreshTimeout();
}else if(window.opener && window.opener.top.refreshTimeout){
window.opener.top.refreshTimeout();
}else{
window.top.location.replace("/");
}
document.oncontextmenu=function(){if(window.event){event.returnValue=false;};return false;};
//document.onselectstart=function(){if(window.event){event.returnValue=false;};return false;};
</script>
</head><body>
<table class="mainframe">
<tr>
<td class="tdframe tdframe1">
<table width="100%">
<tr>
<td width="14"><img src="images/logo2.jpg" width="14" height="14"></td>
<td width="15"> </td>
<td id="nmn_notice_id">welcome ...</td>
<td id="nmn_righttop_id" class="tdrighttop"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="mainconfig_id" class="tdframe tdframe2">
<form name="iform" onsubmit="return false;">
<table class="w760">
<tr><td width="100%">
<table width="100%">
<tr>
<td width="50%">
<table class="tbpgtitle w100">
<tr>
<td class="bgl"> </td>
<td class="bg">系统状态</td>
<td class="bgr"> </td>
</tr>
</table>
<table class="tbedit w100">
<tr>
<td class="list_ar" width="26%">设备编号</td>
<td class="list_al" width="64%">35000071521660 </td>
<td class="list" width="10%"> </td>
</tr>
<tr>
<td class="list_ar">运行时间</td>
<td class="list_al" id="home_uptime_id"></td>
<td class="list"> </td>
</tr>
<tr>
<td class="list_ar">系统时间</td>
<td class="list_al">2011-07-27 06:55:40</td>
<td class="list"><a href="javascript:gotoTarget('settime.htm')">设置</a></td>
</tr>
<tr>
<td class="list_ar">主机名称</td>
<td class="list_al">HLXC-3500 </td>
<td class="list"><a href="javascript:gotoTarget('sysconf.htm')">编辑</a></td>
</tr>
<tr>
<td class="list_ar">固件版本</td>
<td class="list_al" title="Build: 2011-01-28 13:47:20">v1.09-rc7 [ Build 2011-01-28 ]</td>
<td class="list"><a href="javascript:gotoTarget('updatefw.htm')">升级</a></td>
</tr>
</table>
</td>
<td width="20"> </td>
<td>
<table class="tbpgtitle w100">
<tr>
<td class="bgl"> </td>
<td class="bg">资源状态</td>
<td class="bgr"> </td>
</tr>
</table>
<table class="tbedit w100">
<tr>
<td class="list_ar" width="28%">CPU 占用</td>
<td class="list_al" width="72%">
<div style="border:1px solid #7AADC8;height:16px;width:230px">
<span id="cpu_used_background_id" style="position:absolute;height:16px;"><span id="cpu_used_num_id" style="position:absolute;line-height:16px;height:16px">loading...</span></span>
</div>
</td>
</tr>
<tr>
<td class="list_ar">
内存占用
<textarea id="memused_tmp_id" style="display:none"> total used free shared buffers
Mem: 256988 103972 153016 0 1248
Swap: 0 0 0
Total: 256988 103972 153016</textarea>
</td>
<td class="list_al">
<div style="border:1px solid #7AADC8;height:16px;width:230px;font-size:16px;">
<span id="mem_used_background_id" style="position:absolute;height:16px;"><span id="mem_used_num_id" style="position:absolute;line-height:16px;height:16px">loading...</span></span>
</div>
</td>
</tr>
<tr>
<td class="list_ar">会话数</td>
<td class="list_al">445 </td>
</tr>
<tr>
<td class="list_ar">活动主机数</td>
<td class="list_al">38 </td>
</tr>
<tr>
<td class="list_ar">CPU 温度</td>
<td class="list_al" id="temperature_id">℃</td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr>
<script langauge="javascript">
var refreshTimer;
// ifstatus
var mirror_enable="YES";
var mirror_port="7";
var ifmap_eth0="WAN1";
var ifmap_eth1="WAN2";
var ifmap_eth2="WAN3";
var ifmap_eth3="WAN4";
var ifmap_eth4="LAN1";
var ifmap_eth5="LAN2";
var ifmap_eth6="LAN3";
var ifmap_eth7="LAN4";
var ifstatus;
onload=init;
function init()
{
GID("nmn_righttop_id").appendChild(GID("righttop_id"));
GID("nmn_righttop_id").style.paddingRight=60;
setSelect(GID("home_refresh_id"),"");
setTimer();
setUptime();
setCPU();
setMem();
setTemperature();
//ifstatus
initIfStatus();
showIfStatus();
showWanInfo();
showLanInfo();
}
function setTimer(time)
{
if(!time)
time=99999999;
if(time == 99999999){
GID("home_btn_refresh_id").disabled = false;
GID("home_btn_refresh_id").style.cursor="pointer";
}else{
GID("home_btn_refresh_id").disabled = true;
GID("home_btn_refresh_id").style.cursor="default";
}
if(refreshTimer)
clearTimeout(refreshTimer);
refreshTimer = setTimeout(function(){gotoTarget("home.htm?REFRESH_TIME="+time);},parseInt(time)*1000);
}
function getUserTime(time)
{
var day=parseInt(time/86400);
var h=parseInt(time%86400/3600);
var m=parseInt(time%86400%3600/60);
var s=parseInt(time%86400%3600%60);
var t="";
if(day>0){
t=day+" "+"天"+" " +h+" "+"小时"+" "+m+" "+"分"+" "+s+" "+"秒";
}else if(h>0){
t=h+" "+"小时"+" "+m+" "+"分"+" "+s+" "+"秒";
}else if(m>0){
t=m+" "+"分"+" "+s+" "+"秒";
}else{
t=s+" "+"秒";
}
return t;
}
function getUptime()
{
var tmp="1542955.69 1541911.90".split(" ");
tmp=parseInt(tmp);
return tmp;
}
function setUptime()
{
GID("home_uptime_id").innerHTML = getUserTime(getUptime());
}
function setCPU()
{
var reg = /^.+average: (\d+\.\d+).+$/gi;
var tmp=" 06:55:40 up 17 days, 20:35, load average: 0.00, 0.00, 0.00".match(reg);
var cpu_used = parseInt(parseFloat(RegExp.$1) * 100);
if(cpu_used > 30 && cpu_used <= 500){
cpu_used= parseInt((cpu_used - 30)/10 + 30);
}else if(cpu_used>500){
cpu_used=99;
}else if(cpu_used<=0){
cpu_used=1;
}
var cpu_color="#00e800";
if(cpu_used<=75){
cpu_color="#228b22";
}else if(cpu_used<=90){
cpu_color="#ee9a49";
}else{
cpu_color="#ee4000";
}
var cpu_background_width=Math.floor(cpu_used*2.3);
var cpu_font_span_width=cpu_background_width;
var cpu_font_color;
if(cpu_used<76){
cpu_font_color="#000000";
cpu_font_span_width+=3;
}else{
cpu_font_color="#ffffff";
cpu_font_span_width-=30;
}
GID("cpu_used_background_id").style.width=cpu_background_width;
GID("cpu_used_background_id").style.background=cpu_color;
GID("cpu_used_num_id").style.left=cpu_font_span_width;
GID("cpu_used_num_id").style.color=cpu_font_color;
GID("cpu_used_num_id").innerHTML=cpu_used+"%";
}
function setMem()
{
var chk=0;
var tmp=GID("memused_tmp_id").value.replace(/\r/g,"").split("\n");
var reg = /^\s*Mem:\s*(\d+)\s*(\d+).*$/gi;
var tmp=tmp.match(reg);
var mem_used = parseInt((RegExp.$2 - chk) * 100 / (RegExp.$1 - chk));
if(mem_used>=100){
mem_used=99;
}else if(mem_used<=0){
mem_used=1;
}
var mem_color="#00e800";
if(mem_used<=75){
mem_color="#228b22";
}else if(mem_used<=90){
mem_color="#ee9a49";
}else{
mem_color="#ee4000";
}
var mem_background_width=Math.floor(mem_used*2.3);
var mem_font_span_width=mem_background_width;
var mem_font_color;
if(mem_used<76){
mem_font_color="#000000";
mem_font_span_width+=3;
}else{
mem_font_color="#ffffff";
mem_font_span_width-=30;
}
GID("mem_used_background_id").style.width=mem_background_width;
GID("mem_used_background_id").style.background=mem_color;
GID("mem_used_num_id").style.left=mem_font_span_width;
GID("mem_used_num_id").style.color=mem_font_color;
GID("mem_used_num_id").innerHTML=mem_used+"%";
}
function setTemperature()
{
var t=parseInt("49500");
if(isNaN(t))
return false;
GID("temperature_id").innerHTML=parseInt(t/100)/10 + " " + "℃";
}
// ifstatus
function initIfStatus()
{
var c=0,d=0;
ifstatus=GID("ifmode_status_id").value.replace(/\r/g,"").split("\n");
for(var i=0; i<ifstatus.length; i++){
if(ifstatus.length>5){
ifstatus = ifstatus.split(" ");
}else{
d++;
}
}
ifstatus.length -= d;
}
function showIfStatus()
{
var tr1 = GID("port_status_id").insertRow(0);
var tr2 = GID("port_status_id").insertRow(1);
var tr3 = GID("port_status_id").insertRow(2);
var td1,td2,td3;
for(var i=0;i<ifstatus.length+1;i++){
td1=tr1.insertCell(tr1.cells.length);
td1.style.cssText = "line-height:11pt;height:11pt;width:43px;";
td2=tr2.insertCell(tr2.cells.length);
td3=tr3.insertCell(tr3.cells.length);
td3.style.cssText = "line-height:11pt;height:11pt;";
if(i == ifstatus.length){
td1.innerHTML = "";
td2.innerHTML = "";
td3.innerHTML = "";
}else{
td1.innerHTML = "eth" + i;
var img = CE("img");
img.style.cssText = "width:35px;height:29px;";
setImg(img,i);
td2.appendChild(img);
td3.innerHTML=eval("ifmap_eth"+i);
}
}
}
function setImg(img,ethi)
{
var imgsrc="images/";
var imgtitle="";//
if(ifstatus.toLowerCase() == "linkdown"){
imgsrc += "down";
}else{
imgsrc += parseInt(ifstatus) + "m";
}
if(mirror_enable == "YES" && mirror_port ==ethi){
GID("mirror_img_id").src = imgsrc + "-m.gif";
imgsrc += "-m";
}
imgsrc += ".gif";
img.src = imgsrc;
if(ifstatus == "none")
img.title = "未连接";
else if(ifstatus == "1000fdx")
img.title = "1000M全双工";
else if(ifstatus == "1000hdx")
img.title = "1000M半双工";
else if(ifstatus == "100fdx")
img.title = "100M全双工 ";
else if(ifstatus == "100hdx")
img.title = "100M半双工";
else if(ifstatus == "10fdx")
img.title = "10M全双工";
else if(ifstatus == "10hdx")
img.title = "10M半双工 ";
}
</script>
<tr><td height="20"></td></tr>
<tr><td width="100%"><textarea id="ifmode_status_id" style="display:none;">0 linkup 100fdx
1 linkup 100fdx
2 linkup 100fdx
3 linkup 100fdx
4 linkup 1000fdx
5 linkdown none
6 linkup 100fdx
7 linkdown none</textarea>
<table width="100%">
<tr valign="top">
<td width="50%">
<table class="tbpgtitle w100">
<tr>
<td class="bgl"> </td>
<td class="bg">端口状态</td>
<td class="bgr"> </td>
</tr>
</table>
<table class="w100" id="port_status_id"
style="background:#E9F8FF;border:1px #99CCCC solid;text-align:center;"></table>
</td>
<td width="20"></td>
<td>
<table class="tbpgtitle w100">
<tr>
<td class="bgl"> </td>
<td class="bg">端口图例</td>
<td class="bgr"> </td>
</tr>
</table>
<table class="w100" style="background:#E9F8FF;border:1px #99CCCC solid;text-align:center;">
<tr><td colspan="6" style="height:8px;line-height:8px;"> </td></tr>
<tr>
<td style="width:48px;line-height:29px;padding-left:5px;"><img src="images/1000m.gif" width="35" height="29"></td>
<td style="width:48px;"><img src="images/100m.gif" width="35" height="29"></td>
<td style="width:48px;"><img src="images/10m.gif" width="35" height="29"></td>
<td style="width:48px;"><img src="images/down.gif" width="35" height="29"></td>
<td style="width:48px;"><img id="mirror_img_id" src="images/1000m-m.gif" width="35" height="29"></td>
<td> </td>
</tr>
<tr valign="top">
<td style="padding-left:5px;line-height:9pt;">1000M</td>
<td style="line-height:9pt;">100M</td>
<td style="line-height:9pt;"> 10M </td>
<td style="line-height:9pt;">未连接</td>
<td style="line-height:9pt;">镜像口</td>
<td style="line-height:9pt;"> </td>
</tr>
<tr><td colspan="6" style="height:8px;line-height:8px;"> </td></tr>
</table>
</td>
</tr>
</table>
</td></tr>
<tr><td height="20"></td></tr>
<script language="javascript">
var down_speed_wan1="363487";
var up_speed_wan1="106533";
var down_speed_wan2="16823";
var up_speed_wan2="15227";
var down_speed_wan3="41943";
var up_speed_wan3="21647";
var down_speed_wan4="487";
var up_speed_wan4="715";
var down_speed_wan=0;
var up_speed_wan=0;
var xmlHttp;
function doConn(wan,action)
{
if(!checkPermission())
return;
var q=getAuth()+"&WAN_IFACE="+(wan-1);
xmlHttp=createXMLHttpRequest();
xmlHttp.open("POST","home2.htm",true);
xmlHttp.onreadystatechange=doConn2;
xmlHttp.setRequestHeader("If-Modified-Since","0");
xmlHttp.setRequestHeader("Cache-Control","no-cache");
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
xmlHttp.send(q);
showBlockTips(action==1?"正在连接,请稍候 ...":"正在断开重连,请稍候 ...");
}
function doConn2()
{
if(xmlHttp.readyState==4){
if(xmlHttp.status==200 ||xmlHttp.status==0){
if(xmlHttp.responseText.replace(/[^\w]/g,"").indexOf("save_apply_ok") != -1){
setTimeout(function(){hiddenBlock();hiddenBlockTips("force");gotoTarget("home.htm");},6000);
}
}
}
}
function showWanInfo()
{
eval(GID("wan_configlist_id").value);
try{
for(var i=1;i<=4;i++){
if(GID("wan_configlist_id").value.indexOf("WAN"+i) != -1){
var tr=GID("wan_showlist_id").insertRow(GID("wan_showlist_id").rows.length);
for(var j=0; j<8; j++){
tr.insertCell(j);
}
tr.cells.innerHTML="WAN"+i;
tr.cells.title="MAC "+eval("WAN"+i+"_MAC");
var status=eval("WAN"+i+"_LINE_STATUS");
var img=CE("img");
if(status == "UP"){
img.src="images/b1.jpg";
var conntime="";
try{
conntime=eval("WAN"+i+"_CONNTIME");
}catch(econntime){};
if(conntime)
img.title="已连接 "+getUserTime(getUptime()-conntime);
}else{
img.src="images/b2.jpg";
img.title="已断开";
}
tr.cells.style.height=26;
tr.cells.appendChild(img);
var connmode=eval("WAN"+i+"_CONN_MODE");
if(connmode=="PPPOE"){
tr.cells.innerHTML = "PPPoE";
if(status == "UP"){
tr.cells.innerHTML='<a href="#" onclick="doConn('+i+',0)" title="断开后系统会自动重连!" />断开</a>';
}else{
tr.cells.innerHTML='<a href="#" onclick="doConn('+i+',1)" title="自动连接中,请刷新主页..." />手动连接</a>';
}
}else if(connmode=="STATIC"){
tr.cells.innerHTML = "静态IP";
}else if(connmode=="DHCP"){
tr.cells.innerHTML = "DHCP";
}
var ipaddr="";
try{
ipaddr=eval("WAN"+i+"_IPADDR");
}catch(e2){};
if(ipaddr){
tr.cells.innerHTML = ipaddr+"/"+eval("WAN"+i+"_NETMASK");
}else{
tr.cells.innerHTML = "/";
}
var gateway="";
try{
gateway=eval("WAN"+i+"_GATEWAY");
tr.cells.innerHTML = gateway;
}catch(e3){};
var dns="";
try{
dns=eval("WAN"+i+"_DNS1");
try{
dns+=" "+eval("WAN"+i+"_DNS2");
}catch(e5){};
tr.cells.innerHTML=dns;
}catch(e4){};
var ds=eval("down_speed_wan"+i);
if(ds){
ds=parseInt(ds);
}else{
ds=0;
}
down_speed_wan+=ds;
var us=eval("up_speed_wan"+i);
if(us){
us=parseInt(us);
}else{
us=0;
}
up_speed_wan+=us;
tr.cells.innerHTML=toKSpeed(ds,0)+"/"+toKSpeed(us,0);
tr.cells.title=toHByteSpeed(ds)+"/"+toHByteSpeed(us);
}
}
}catch(e){}
}
</script>
<tr><td>
<table width="100%">
<tr>
<td width="100%"><textarea id="wan_configlist_id" style="display:none">WAN1_IFACE='ppp0'
WAN1_MAC='00:31:4e:67:00:E9'
WAN1_MTU='1500'
WAN1_CONN_MODE='PPPOE'
WAN1_ISP='ctc'
WAN1_IPADDR='111.1.1.88'
WAN1_NETMASK='32'
WAN1_GATEWAY='125.85.192.1'
WAN1_SUBNET='255.255.255.255'
WAN1_DNS1='61.128.192.68'
WAN1_DNS2='61.128.128.68'
WAN1_CONNTIME='1455852'
WAN1_LINE_STATUS='UP';WAN2_IFACE='ppp1'
WAN2_MAC='00:31:4F:6e:00:EA'
WAN2_MTU='1500'
WAN2_CONN_MODE='PPPOE'
WAN2_ISP='ctc'
WAN2_IPADDR='121.1.4.5'
WAN2_NETMASK='32'
WAN2_GATEWAY='125.85.192.1'
WAN2_SUBNET='255.255.255.255'
WAN2_DNS1='61.128.192.68'
WAN2_DNS2='61.128.128.68'
WAN2_CONNTIME='1455912'
WAN2_LINE_STATUS='UP';WAN3_IFACE='ppp2'
WAN3_MAC='00:31:4F:67:00:Ee'
WAN3_MTU='1500'
WAN3_CONN_MODE='PPPOE'
WAN3_ISP='ctc'
WAN3_IPADDR='121.1.229.1'
WAN3_NETMASK='32'
WAN3_GATEWAY='125.85.192.1'
WAN3_SUBNET='255.255.255.255'
WAN3_DNS1='61.128.192.68'
WAN3_DNS2='61.128.128.68'
WAN3_CONNTIME='1455853'
WAN3_LINE_STATUS='UP';WAN4_IFACE='eth4'
WAN4_MAC='00:d1:4F:67:00:EC'
WAN4_MTU='1500'
WAN4_CONN_MODE='STATIC'
WAN4_ISP='cnc'
WAN4_IPADDR='11.20.11.11'
WAN4_NETMASK='30'
WAN4_GATEWAY='11.20.11.10'
WAN4_SUBNET='255.255.255.252'
WAN4_DNS1='221.7.92.98'
WAN4_DNS2='221.5.203.98'
WAN4_CHECK_MODE='DISABLE'
WAN4_CONNTIME='1124641'
WAN4_LINE_STATUS='UP';</textarea>
<table class="tbpgtitle w100">
<tr>
<td class="bgl"> </td>
<td class="bg">广域网接口</td>
<td class="bgr"> </td>
</tr>
</table>
<table class="tblist w100" id="wan_showlist_id">
<tr>
<td width="6%">接口</td>
<td width="6%">状态</td>
<td width="8%">类型</td>
<td width="20%">IP地址/掩码</td>
<td width="16%">网关</td>
<td width="16%">DNS服务器</td>
<td width="18%">接收/发送速率(Kbps)</td>
<td width="10%">操作</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr><td height="20"></td></tr>
<script language="javascript">
var lan_list;
function showLanInfo()
{
lan_list = [];
var tmp=GID("lan_configlist_id").value.replace(/\r/g,"").split("\n");
for(var i=0; i<tmp.length; i++){
if(tmp.length>5){
lan_list = tmp.split(" ");
}
}
for(var i=0;i<lan_list.length;i++){
var tr=GID("lan_showlist_id").insertRow(GID("lan_showlist_id").rows.length);
tr.className="listbg"+i%2;
for(var j=0;j<4;j++){
tr.insertCell(j);
}
tr.cells.innerHTML=i+1;
tr.cells.innerHTML=lan_list;
tr.cells.innerHTML=lan_list;
tr.cells.innerHTML=lan_list.replace("ENABLE","启用").replace("DISABLE","禁用");
if(i==0){
for(var j=4;j<8;j++){
tr.insertCell(j);
tr.cells.rowSpan=lan_list.length;
}
tr.cells.innerHTML=toKSpeed(up_speed_wan,0);
tr.cells.title=toHByteSpeed(up_speed_wan);
tr.cells.innerHTML=toKSpeed(down_speed_wan,0);
tr.cells.title=toHByteSpeed(down_speed_wan);
tr.cells.innerHTML="00:17:16:02:20:2E";
tr.cells.innerHTML="1500";
}
}
}
</script>
<tr><td width="100%"><textarea id="lan_configlist_id" style="display:none">192.168.0.1 255.255.255.0 ENABLE </textarea>
<table class="w100">
<tr>
<td width="100%">
<table class="tbpgtitle w100">
<tr>
<td class="bgl"> </td>
<td class="bg">局域网接口</td>
<td class="bgr"> </td>
</tr>
</table>
<table class="tblist w100" id="lan_showlist_id">
<tr>
<td width="6%">ID</td>
<td width="14%">IP 地址</td>
<td width="14%">子网掩码</td>
<td width="13%">网络地址转换</td>
<td width="14%">接收速率(Kbps)</td>
<td width="14%">发送速率(Kbps)</td>
<td width="15%">MAC 地址</td>
<td width="10%">MTU</td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr>
<tr><td height="20"></td></tr>
<tr><td width="100%">
<table width="100%">
<tr>
<td width="100%">
<table class="tbpgtitle w100">
<tr>
<td class="bgl"> </td>
<td class="bg">告警日志</td>
<td background="images/aa3.jpg" width="70"><a href="javascript:gotoTarget('nmnlog.htm?logtype=warning')">更多...</a></td>
<td class="bgr"> </td>
</tr>
</table>
<table class="tblist w100">
<tr class="list">
<td width="20%">时间</td>
<td width="7%">级别</td>
<td width="73%">消息</td>
</tr>
<tr class="list">
<td>2011-07-26 07:18:55</td>
<td>严重</td>
<td style="text-align:left;padding-left:8px;">端口 eth0 已连接, 模式: 100M 、全双工。</td>
</tr>
<tr class="list">
<td>2011-07-26 07:16:18</td>
<td>严重</td>
<td style="text-align:left;padding-left:8px;">端口 eth0 已断开连接。</td>
</tr>
<tr class="list">
<td>2011-07-26 07:08:55</td>
<td>严重</td>
<td style="text-align:left;padding-left:8px;">端口 eth1 已连接, 模式: 100M 、全双工。</td>
</tr>
<tr class="list">
<td>2011-07-26 07:07:48</td>
<td>严重</td>
<td style="text-align:left;padding-left:8px;">端口 eth2 已连接, 模式: 100M 、全双工。</td>
</tr>
<tr class="list">
<td>2011-07-26 06:58:55</td>
<td>严重</td>
<td style="text-align:left;padding-left:8px;">端口 eth1 已断开连接。</td>
</tr>
</table>
</td>
</tr>
</table>
</tr>
<tr><td height="20"></td></tr>
<tr><td width="100%">
<table width="100%">
<tr>
<td width="100%">
<table class="tbpgtitle w100">
<tr>
<td class="bgl"> </td>
<td class="bg">安全日志</td>
<td background="images/aa3.jpg" width="70"><a href="javascript:gotoTarget('nmnlog.htm?logtype=security')">更多...</a></td>
<td class="bgr"> </td>
</tr>
</table>
<table class="tblist w100">
<tr class="list">
<td width="20%">时间</td>
<td width="7%">级别</td>
<td width="73%">消息</td>
</tr>
<tr class="list">
<td>2011-07-27 06:43:01</td>
<td>严重</td>
<td style="text-align:left;padding-left:8px;">内网攻击: 主机 192.168.0.45 硬件地址 00:21:27:AD:6A:76 使用洪水攻击!速度: 10782个包/秒。</td>
</tr>
<tr class="list">
<td>2011-07-27 06:38:18</td>
<td>严重</td>
<td style="text-align:left;padding-left:8px;">内网攻击: 主机 192.168.0.45 硬件地址 00:21:27:AD:6A:76 使用洪水攻击!速度: 9649个包/秒。</td>
</tr>
<tr class="list">
<td>2011-07-27 06:37:14</td>
<td>严重</td>
<td style="text-align:left;padding-left:8px;">内网攻击: 主机 192.168.0.45 硬件地址 00:21:27:AD:6A:76 使用洪水攻击!速度: 11620个包/秒。</td>
</tr>
<tr class="list">
<td>2011-07-27 06:36:09</td>
<td>严重</td>
<td style="text-align:left;padding-left:8px;">内网攻击: 主机 192.168.0.45 硬件地址 00:21:27:AD:6A:76 使用洪水攻击!速度: 11712个包/秒。</td>
</tr>
<tr class="list">
<td>2011-07-27 06:35:09</td>
<td>严重</td>
<td style="text-align:left;padding-left:8px;">内网攻击: 主机 192.168.0.45 硬件地址 00:21:27:AD:6A:76 使用洪水攻击!速度: 11955个包/秒。</td>
</tr>
</table>
</td>
</tr>
</table>
</tr>
<tr><td height="20"></td></tr>
</table>
</form>
<div id="righttop_id">
<SELECT id="home_refresh_id" onchange="setTimer(this.value)">
<OPTION value="99999999">手动刷新</OPTION>
<OPTION value="15">每15秒自动刷新</OPTION>
<OPTION value="30">每30秒自动刷新</OPTION>
<OPTION value="60">每1分钟自动刷新</OPTION>
</SELECT>
<input id="home_btn_refresh_id" class="formbtn2" type="button" value="刷新"
onclick="javascript:gotoTarget('home.htm?REFRESH_TIME=99999999')" />
</div>
<div id="blockUI" class="blockui">
<iframe id="blockui_ifame_id" style="width:836px;height:300px;background-color:#000000;-moz-opacity:0.1;opacity:0.1;filter:alpha(opacity=10);"></iframe>
</div>
<div id="blockTips_id" class="blocktips"> </div>
</td>
</tr>
<tr>
<td class="tdframe tdframe3"><img src="images/bj4.jpg" /></td>
</tr>
<tr>
<td class="tdframe4">
ttt © tttt
<a id="nmn_service_id" href="#" class="service" onfocus="this.blur()" onclick="getService(event)">
<img class="fs" src="images/w1w0.png" />
<img class="s0" src="images/w1w1.png" />
<img class="s" src="images/w1w2.png" id="service_onlinetech" />
<img class="s" src="images/w1w3.png" id="service_fwupdate" />
<img class="s" src="images/w1w4.png" id="service_productregister" />
<img class="s" src="images/w1w5.png" id="service_question" />
<img class="s" src="images/w1w6.png" id="service_homepage"/>
<img class="s0" src="images/w1w.png" />
</a>
</td>
</tr>
</table>
</body>
</html>
我想过用正则 ,但是我不会,哪位大虾能帮忙解决下!感激万分! 位数固定的话\d{5}\.\d{3} 本帖最后由 viplight 于 2011-7-27 07:20 编辑
回复 2# lpxx
谢谢您,第一个问题解决了,我经过多次测试观察,那个随机数貌似固定了位数了的, 回复 3# viplight
究竟想提取的"指定的字符串"是什么? 回复 4# 3mile
就是HTML的
555、567、579和591行对应的IP地址,这个是路由器里面的HTML,我想通过路由
器获取我的外网IP,因为都是用的ADsl
多线路用其它的网站获取的话不准却 (?i)(?<=WAN\d_IPADDR=').*?(?=') 都是高人。。看得头晕。。。膜拜下{:1_588:} 回复 6# 3mile
主要是这段HTML的代码要怎么读取呢 已经解决了打开问题,目前适用的是fileopen来打开用FileReadLine来读取,谢谢3mile 的正则 用上了,{:face (303):}
页:
[1]