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;
}
相关文档:
1 使用标准HTML来进行图片上传
前台代码:
<body>
<form id="form1" runat="server">
<div>
<table>
&nbs ......
前台代码:
<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=" ......
Request.ServerVariables["Url"]
返回服务器地址
Request.ServerVariables["Path_Info"]
客户端提供的路径信息
Request.ServerVariables["Appl_Physical_Path"]
与应用程序元数据库路径相应的物理路径
Request.ServerVariables["Path_Translated"]
通过由虚拟至物理的映射后得到的路径
Request.ServerVariables ......