asp.net IP限制登陆
//思路:将其IP存入数据库的时候,以数字的形式存入.即可比较大小.
//比如:192.168.1.1 凡是后面位数不满3位的都以0填充.....那么存入形式为:192168001001
//因为:1只有一位...所以加00这样数据库中全部的都为12位的数字,即可比较.
public string getip(string ip)
{
String[] arr=ip.Split(new char[] {'.'});
string str = "";
for (int i = 0; i < arr.Length; i++)
{
if (str == "")
{
string str1="000" + arr[0].ToString();
str = str1.Substring(str1.Length - 3);
}
else
{
string str1 = "000" + arr[i].ToString();
str = str + str1.Substring(str1.Length - 3);
}
}
return str;
}
相关文档:
上次我们说到的编译成的dll文件与cs文件在同一目录中,而不会放到虚拟目录的bin目录中,如何做才能够把cs
文件编译成dll且自动放到虚拟目录的bin文件夹中呢?
开始-------程序-------Microsoft Visual Studio.NET 2003-------Visual Studio.NET工具,点击其中的“Visual Studio.NET2003命令提示”,就会进入Mic ......
1 使用标准HTML来进行图片上传
前台代码:
<body>
<form id="form1" runat="server">
<div>
<table>
&nbs ......
<asp:DropDownList ID="compactType" runat="server" AutoCallBack="True" Width="153px"> </asp:DropDownList>
<?xml version="1.0" encoding="utf-8" ?>
<roots>
<root>
<id>1</id>
<Culture> ......
前台代码:
<script type="text/javascript">
<%=LoadImage() %>
imgUrl1="uploads/"+ImgSrc[0];
imgtext1=ImgAlt[0]
imgLink1=escape("adimg.aspx?Img_ID="+ImgUrl[0]);
imgUrl2="uploads/"+ImgSrc[1];
imgtext2=ImgAlt[1]
imgLink2=escape("adimg.aspx?Img_ID="+ImgUrl[1]);
imgUrl3=" ......