asp.net 身份验证
1、给web.config添加<authentication>元素
2、给web.config文件添加<forms>元素
<forms name=".aspxauth" loginUrl="Login.aspx" protection="All" timeout="30" path="/" requireSSL="false" slidingExpiration="true" cookieless="UseDeviceProfile"></forms>
3、FormsAuthentication.RedirectfromLoginPage("sdsdsd", true); 设置cookie
4、FormsAuthentication.Authenticate("12", "12") 根据web.config配置验证
web.config配置
<authentication mode="Forms">
<forms name=".aspxauth" loginUrl="Login.aspx" protection="All" timeout="30" path="/" requireSSL="false" slidingExpiration="true" cookieless="UseDeviceProfile">
<credentials passwordFormat="Clear">
<user name="12" password="12"/>
</credentials>
</forms>
</authentication>
相关文档:
在Web编程过程中,存在着很多安全隐患。比如在以前的ASP版本中,Cookie为访问者和编程者都提供了方便,并没有提供加密的功能。打开IE浏览器,选择“工具”菜单里的“Internet选项”,然后在弹出的对话框里单击“设置”按钮,选择“查看文件”按钮,在弹出的窗口中,就会显示硬盘里 ......
asp.net有时候常常用服务器绑定控件有些麻烦...
代码有些杂....
using System;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Web;
using System.Text;
namespace pub.mo
{
public class bind
{
p ......
在开发中经常可以碰到类似的问题: 想通过一个树父节点的TreeNodeCheckChanged 事件( 前提是设置TreeView 的CheckBox 可见), 来选择或反选择全部的子节点, 来实现自己的要实现的操作功能. 于是我们很正常的思维促使我们去寻找TreeView 的的类似于 ” CheckChanged ” 的事件, 很容易我们找到了这个事件 ” ......
jquery通过post传递数据到服务器(不使用插件):
<html>
<head>
<title>Untitled Page</title>
<script language="javascript" type="text/javascript" src="js/jquery-1.3.1.js"></script>
<script language="ja ......
第一:
private void Button1_Click( object sender, System.EventArgs e ) { Response.Redirect( Request.Url.ToString( ) ); }
第二:
private void Button2_Click( object sender, System.EventArgs e ) { Response.Write( " < script language=javascript>window.location.href=document.URL; < /script& ......