偶做留言本的时候想起做这么个,具体思路也许不好,做出来只是抛砖引玉,希望有更好的方法!
ip添加页是用了一个listbox, textbox,两个button
而在其他的页上则直接用当前ip对比数据库中的ip,代码如下!
限制ip添加页html代码
<%@ page language="c#" autoeventwireup="true" codefile="ip.aspx.cs" inherits="admin_ip" %>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<link href="../images/news.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:sqldatasource id="sqldatasource1" runat="server" connectionstring="<%$ connectionstrings:book %>"
providername="<%$ connectionstrings:book.providername %>" selectcommand="select [ip] from [ip]">
</asp:sqldatasource>
<table align="center" style="border-right: #0066cc 1px dotted; border-top: #0066cc 1px dotted; border-left: #0066cc 1px dotted; border-bottom: #0066cc 1px dotted">
<tr>
<td rowspan="2" style="width: 100px; border-right: #33ccff 1px groove; border-top: #33ccff 1px groove; border-left: #33ccff 1px groove; border-bottom: #33ccff 1px groove;">
<asp:listbox id="iplxb" runat="server" datasourceid="sqldatasource1" datatextfield="ip"
datavaluefield="ip" height="194px" width="153px"></asp:listbox></td>
<td style="width: 100px; border-right: #33ccff 1px groove; border-top: #33ccff 1px groove; border-left: #33ccff 1px groove; border-bottom: #33ccff 1px groove;">
填写标准的ip地址到左下文本框里面,然后点击按纽添加!<br />
<asp:regularexpressionvalidator id="regularexpressionvalidator1" runat="server" controltovalidate="iptb"
display="dynamic" errormessage="ip地址格式不正确" validationexpression="([0-9]{2,3})([.])([0-9]{1,3})([.])([0-9]{1,3})([.])([0-9]{1,3})"></asp:regularexpressionvalidator></td>
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器