.net 做的IP 访问限制 (1)
点击次数:23 次 发布日期:2008-11-26 12:16:08 作者:源代码网
|
源代码网推荐 源代码网推荐 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> 源代码网推荐 源代码网推荐 源代码网推荐 源代码网推荐 做人要厚道,请注明转自酷网动力(www.ASPCOOL.COM)。 源代码网推荐 源代码网供稿. |
