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 ......
代码很简单的,我把我平时写过的贴出来给大家看看:
if (bResult == true) //登录的用户名和密码正确
{
//保存登录的用户名
Session["LoginUser"] = FormatString.Replace(txtLoginUser.Text); //这里就是给session赋值了 ......
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"Cambria Mat ......
我们可以继承 ASP.NET 的 Page 类别,自行扩充所需的功能!作法如下:
1、继承 System.Web.UI.Page,自订一个 BasePage 类别。
以下为引用的内容:
using
System;
/// <summary>
/// BasePage 的摘要描述
///&nbs ......