|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
最后我再次声明,我并没有说不看好java,实际上我对java很乐观的,毕竟她正在不断改进中,我相信她总有一天会和.net并驾齐驱的ip地点IP地点查询的完成办法大概和人人本人的设法不是一样的。人人能够看看一样平常的完成办法。
ipQueary.jsp
<%@pagecontentType="text/html;charset=gb2312"language="java"import="java.sql.*"%>
<jsp:useBeanid="user"scope="page"class="user.db"/>
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
<title>IP查询</title>
</head>
<LINKhref="CSS/style.css"_fcksavedurl=""css/style.css""_fcksavedurl=""css/style.css""rel=stylesheettype="text/css">
<body>
<divalign="center"><fontcolor="#0000FF"size="2"><strong>IP查询了局</strong></font></div>
<br>
<%
Connectioncon=user.getConn();
Statementstmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
Stringsql;
ResultSetrs;
if(request.getParameter("ip1")!=null){
Stringnumber1=request.getParameter("ip1").trim();
Stringnumber2=request.getParameter("ip2").trim();
Stringnumber3=request.getParameter("ip3").trim();
Stringnumber4=request.getParameter("ip4").trim();
Stringnumber=number1+"."+number2+"."+number3+"."+number4;
sql="select*fromipaddrwherebeginaddr<="+number+"andendaddr>="+number+"andleft(beginaddr,3)="+number1+"andleft(endaddr,3)="+number1+"andsubstring(beginaddr,5,3)="+number2+"and"+number2+"=substring(endaddr,5,3)andsubstring(beginaddr,9,3)="+number3+"and"+number3+"=substring(endaddr,9,3)";
rs=stmt.executeQuery(sql);
if(!rs.next()){
sql="select*fromipaddrwherebeginaddr<="+number+"andendaddr>="+number+"andleft(beginaddr,3)="+number1+"andleft(endaddr,3)="+number1+"andsubstring(beginaddr,5,3)="+number2+"and"+number2+"=substring(endaddr,5,3)";
rs=stmt.executeQuery(sql);
if(!rs.next()){
sql="select*fromipaddrwherebeginaddr<="+number+"andendaddr>="+number+"andleft(beginaddr,3)="+number1+"andleft(endaddr,3)="+number1+"";
rs=stmt.executeQuery(sql);
if(!rs.next()){
sql="select*fromipaddrwherebeginaddr<="+number+"andendaddr>="+number+"";
rs=stmt.executeQuery(sql);
}
}
}
if(rs.next()){
%>
</div>
<tableborder=1width=500align="center">
<tr>
<tdwidth=100%colspan=2align=middleheight=22class=btn>搜刮了局:</td>
</tr>
<tr>
<tdwidth=28%align=middleheight=22class=btn>你要搜刮的IP地点:</td>
<tdwidth=72%align=middleheight=22class=btn><%=number%></td>
</tr>
<tr>
<tdwidth=28%align=middleheight=22class=btn>查询了局:</td>
<tdwidth=72%align=middleheight=22class=btn><%=rs.getString("country")%><fontcolor="#FF0000">:</font><%=rs.getString("city")%><fontcolor="#FF0000">:</font><%=rs.getString("detail")%></td>
</tr>
</table>
<%
}else
{
%>
<tableborder=1cellpadding=4width=500align=center>
<tr>
<tdwidth=100%colspan=2align=middleheight=22class=btn>搜刮了局:</td>
</tr>
<tr>
<tdwidth=28%align=middleheight=22bgcolor=#eff1f3class=btn>你要搜刮的IP地点:</td>
<tdwidth=72%align=middleheight=22bgcolor=#eff1f3class=btn><%=number%></td>
</tr>
<tr>
<tdwidth=28%align=middleheight=22bgcolor=#eff1f3class=btn>查询了局:</td>
<tdwidth=72%align=middleheight=22bgcolor=#eff1f3class=btn>没有找到!!</td>
</tr>
</table>
<%
}
}%>
</html>
ruby里有这些工具吗?又要简单多少?我没有用过这两门语言,我估计在这些语言力没有很统一的这种标准,或者根本就没有提供。 |
|