使用ASP.NET的权限系统
1. 生成aspnet的权限数据表和sp,使用.net 2.0的命令如下:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regsql -W
使用-W参数调出连接数据库向导,根据向导生成数据库数据。
2. 在web.config更改验证方式并添加providers
<configuration>
<connectionStrings>
<add name="dbConnString" connectionString="<Your Database Connection String>" />
</connectionStrings>
<system.web>
<authentication mode="Forms" >
<forms loginUrl="login.aspx"
name=".ASPXFORMSAUTH" />
</authentication>
<authorization>
<deny users="?" />
</authorization>
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add
name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="dbConnString"
applicationName="MyApplication"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
passwordFormat="Hashed" />
</providers>
</membership>
profile>
<providers>
<add name="AspNetProfileProvider" connectionStringName="dbConnString" applicationName="/" type="System.Web.Profile.SqlProfileProvider" />
</providers>
</profile>
<roleManager enabled="true" defaultProvider="AspNetRoleProvider">
<providers>
<clear />
<add connectionStringName="dbConnString" applicationName="/"
name="AspNetRoleProvider" type="System.Web.Security.SqlRoleProvider" />
</providers>
</roleManager>
</system.web>
</configuration>
3. 通过Web Site Administratio
相关文档:
http://www.codeproject.com/KB/aspnet/ASPDOTNETPageLifecycle.aspx?msg=3443071#xx3443071xx
ASP.NET application and page life cycle
Introduction
The Two step process
Creation of ASP.NET environment
Process request using MHPM events fired
In What event we should do what?
A sample code for demons ......
/// <summary>
/// HTML解码
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public string HtmlDecode(string input)
&nb ......
1:a=10,b=15,在不用第三方变量的前提下,把a,b的值互换
2:已知数组int[] max={6,5,2,9,7,4,0};用快速排序算法按降序对其进行排列,并返回数组
3:请简述面向对象的多态的特性及意义!
4:session喜欢丢值且占内存,Cookis不安全,请问用什么办法代替这两种原始的方法
5:对数据的并发采用什么办法进行处理较好。
6 ......
ASP.NET Cookie 概述
Cookie 提供了一种在 Web 应用程序中存储用户特定信息的方法。例如,当用户访问您的站点时,您可以使用 Cookie 存储用户首选项或其他信息。当该用户再次访问您的网站时,应用程序便可以检索以前存储的信息。
什么是 Cookie?
Cookie 是一小段文本信息,伴随着用户请求和页面在 Web 服务器和浏览器之 ......
给页面的TextBox设置ReadOnly="True"时,在后台代码中不能赋值取值,下边几种方法可以避免:
1、不设置ReadOnly,设置onfocus=this.blur()
C#代码
<asp:TextBox ID="TextBox1" runat="server" onfocus=this.blur()></asp:TextBox>
<asp:TextBox ID="TextBox1" runat="serve ......