代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
Asp.Net
】
asp.net2.0密码强度验证
作者:
Dezai.CN
/ 发布于
2011/9/4
/
800
<div> <span style="background-color: #ffff99"><span size="2">1、建立Default.aspx文件,代码如下:</span></span> <div class="cnblogs_Highlighter"> <div id="highlighter_672708" class="syntaxhighlighter nogutter csharp"> <div class="bar "> <div class="toolbar"></div> </div> <div class="lines"> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"><%@ Page Language="csharp string"><font color="#0000ff">"C#"</font> "csharp plain">AutoEventWireup="csharp string"><font color="#0000ff">"true"</font> "csharp plain">CodeFile="csharp string"><font color="#0000ff">"Default.aspx.cs"</font> "csharp plain">Inherits="csharp string"><font color="#0000ff">"_Default"</font> "csharp plain">%></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"><!DOCTYPE html PUBLIC "csharp string"><font color="#0000ff">"-//W3C//DTD XHTML 1.0 Transitional//EN"</font> "csharp string"><font color="#0000ff">"</font></span>"csharp string"><a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><span style="background-color: #ffff99"><font color="#0000ff">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</font></span></a><span style="background-color: #ffff99">"csharp string"><font color="#0000ff">"</font>"csharp plain">></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"><html xmlns="csharp string"><font color="#0000ff">"</font></span>"csharp string"><a href="http://www.w3.org/1999/xhtml"><span style="background-color: #ffff99"><font color="#0000ff">http://www.w3.org/1999/xhtml</font></span></a><span style="background-color: #ffff99">"csharp string"><font color="#0000ff">"</font> "csharp plain">></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"><head runat="csharp string"><font color="#0000ff">"server"</font>"csharp plain">></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"><title>无标题页</title></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"></head></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"><script language="csharp string"><font color="#0000ff">"javascript"</font> "csharp plain">type="csharp string"><font color="#0000ff">"text/javascript"</font>"csharp plain">> </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp comments"><font color="#008200">//CharMode函数 </font></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp comments"><font color="#008200">//测试某个字符是属于哪一类. </font></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">function CharMode(iN){ </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">if</font></strong> "csharp plain">(iN>=48 && iN <=57) "csharp comments"><font color="#008200">//数字 </font></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">return</font></strong> "csharp plain">1; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">if</font></strong> "csharp plain">(iN>=65 && iN <=90) "csharp comments"><font color="#008200">//大写字母 </font></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">return</font></strong> "csharp plain">2; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">if</font></strong> "csharp plain">(iN>=97 && iN <=122) "csharp comments"><font color="#008200">//小写 </font></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">return</font></strong> "csharp plain">4; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">else</font></strong></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">return</font></strong> "csharp plain">8; "csharp comments"><font color="#008200">//特殊字符 </font></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">} </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp comments"><font color="#008200">//bitTotal函数 </font></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp comments"><font color="#008200">//计算出当前密码当中一共有多少种模式 </font></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">function bitTotal(num){ </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">modes=0; </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">for</font></strong> "csharp plain">(i=0;i<4;i++){ </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">if</font></strong> "csharp plain">(num & 1) modes++; </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">num>>>=1; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">} </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">return</font></strong> "csharp plain">modes; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">} </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp comments"><font color="#008200">//checkStrong函数 </font></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp comments"><font color="#008200">//返回密码的强度级别 </font></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">function checkStrong(sPW){ </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">if</font></strong> "csharp plain">(sPW.length<=4) </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">return</font></strong> "csharp plain">0; "csharp comments"><font color="#008200">//密码太短 </font></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">Modes=0; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">for</font></strong> "csharp plain">(i=0;i<sPW.length;i++){ </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp comments"><font color="#008200">//测试每一个字符的类别并统计一共有多少种模式. </font></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">Modes|=CharMode(sPW.charCodeAt(i)); </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">} </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">return</font></strong> "csharp plain">bitTotal(Modes); </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">} </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp comments"><font color="#008200">//pwStrength函数 </font></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp comments"><font color="#008200">//当用户放开键盘或密码输入框失去焦点时,根据不同的级别显示不同的颜色 </font></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">function pwStrength(pwd){ </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">O_color="csharp string"><font color="#0000ff">"#e0f0ff"</font>"csharp plain">; </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">L_color="csharp string"><font color="#0000ff">"#FF0000"</font>"csharp plain">; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">M_color="csharp string"><font color="#0000ff">"#FF9900"</font>"csharp plain">; </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">H_color="csharp string"><font color="#0000ff">"#33CC00"</font>"csharp plain">; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">if</font></strong> "csharp plain">(pwd=="csharp keyword"><strong><font color="#006699">null</font></strong>"csharp plain">||pwd=="csharp string"><font color="#0000ff">''</font>"csharp plain">){ </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">Lcolor=Mcolor=Hcolor=O_color; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">} </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">else</font></strong></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">{ </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">S_level=checkStrong(pwd); </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">switch</font></strong>"csharp plain">(S_level)</span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">{ </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">case</font></strong> "csharp plain">0: </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">Lcolor=Mcolor=Hcolor=O_color; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">case</font></strong> "csharp plain">1: </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">Lcolor=L_color; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">Mcolor=Hcolor=O_color; </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">break</font></strong>"csharp plain">; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">case</font></strong> "csharp plain">2: </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">Lcolor=Mcolor=M_color; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">Hcolor=O_color; </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">break</font></strong>"csharp plain">; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">default</font></strong>"csharp plain">: </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">Lcolor=Mcolor=Hcolor=H_color; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">} </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">} </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">document.getElementById("csharp string"><font color="#0000ff">"strength_L"</font>"csharp plain">).style.background=Lcolor; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">document.getElementById("csharp string"><font color="#0000ff">"strength_M"</font>"csharp plain">).style.background=Mcolor; </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">document.getElementById("csharp string"><font color="#0000ff">"strength_H"</font>"csharp plain">).style.background=Hcolor; </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">return</font></strong>"csharp plain">; </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">} </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"></script> </span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"><body></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"><form id="csharp string"><font color="#0000ff">"form1"</font> "csharp plain">runat="csharp string"><font color="#0000ff">"server"</font>"csharp plain">></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"><div></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">输入密码:<asp:TextBox ID="csharp string"><font color="#0000ff">"TextBox1"</font> "csharp plain">runat="csharp string"><font color="#0000ff">"server"</font> "csharp plain">onKeyUp=pwStrength("csharp keyword"><strong><font color="#006699">this</font></strong>"csharp plain">.value) onBlur=pwStrength("csharp keyword"><strong><font color="#006699">this</font></strong>"csharp plain">.value) ></asp:TextBox></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">密码强度:</span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"><table border="csharp string"><font color="#0000ff">"1"</font> "csharp plain">cellpadding="csharp string"><font color="#0000ff">"1"</font> "csharp plain">borderColorDark="csharp string"><font color="#0000ff">"#fdfeff"</font> "csharp plain">borderColorLight="csharp string"><font color="#0000ff">"#99ccff"</font> "csharp plain">cellspacing="csharp string"><font color="#0000ff">"1"</font> "csharp plain">style="csharp string"><font color="#0000ff">"width: 200px; display: inline; background-color:#e0f0ff"</font>"csharp plain">></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"><tr></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"><td id="csharp string"><font color="#0000ff">"strength_L"</font> "csharp plain">style="csharp string"><font color="#0000ff">"width: 100px; height: 19px;"</font> "csharp plain">align="csharp string"><font color="#0000ff">"center"</font>"csharp plain">></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">弱</td></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"><td id="csharp string"><font color="#0000ff">"strength_M"</font> "csharp plain">style="csharp string"><font color="#0000ff">"width: 100px; height: 19px;"</font> "csharp plain">align="csharp string"><font color="#0000ff">"center"</font>"csharp plain">></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">中</td></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"><td id="csharp string"><font color="#0000ff">"strength_H"</font> "csharp plain">style="csharp string"><font color="#0000ff">"width: 100px; height: 19px;"</font> "csharp plain">align="csharp string"><font color="#0000ff">"center"</font>"csharp plain">></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">强</td></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"></tr></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"></table></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"></div></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"></form></span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"></body></span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain"></html></span></td> </tr> </tbody> </table> </div> </div> </div> </div> <span style="background-color: #ffff99"><span size="2">2、Default.aspx.cs代码如下:</span></span> <div class="cnblogs_Highlighter"> <div id="highlighter_287752" class="syntaxhighlighter nogutter csharp"> <div class="bar show"> <div class="toolbar"><a style="width: 16px; height: 16px" class="item viewSource" title="view source" href="http://www.cnblogs.com/xiaopohou/archive/2011/09/04/2166511.html#viewSource"><span style="background-color: #ffff99">view source</span></a><a style="width: 16px; height: 16px" class="item printSource" title="print" href="http://www.cnblogs.com/xiaopohou/archive/2011/09/04/2166511.html#printSource"><span style="background-color: #ffff99">print</span></a><a style="width: 16px; height: 16px" class="item about" title="?" href="http://www.cnblogs.com/xiaopohou/archive/2011/09/04/2166511.html#about"><span style="background-color: #ffff99">?</span></a></div> </div> <div class="lines"> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">using</font></strong> "csharp plain">System;</span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">using</font></strong> "csharp plain">System.Data;</span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">using</font></strong> "csharp plain">System.Configuration;</span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">using</font></strong> "csharp plain">System.Web;</span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">using</font></strong> "csharp plain">System.Web.Security;</span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">using</font></strong> "csharp plain">System.Web.UI;</span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">using</font></strong> "csharp plain">System.Web.UI.WebControls;</span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">using</font></strong> "csharp plain">System.Web.UI.WebControls.WebParts;</span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">using</font></strong> "csharp plain">System.Web.UI.HtmlControls;</span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">public</font></strong> "csharp keyword"><strong><font color="#006699">partial</font></strong> "csharp keyword"><strong><font color="#006699">class</font></strong> "csharp plain">_Default : System.Web.UI.Page </span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">{</span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp keyword"><strong><font color="#006699">protected</font></strong> "csharp keyword"><strong><font color="#006699">void</font></strong> "csharp plain">Page_Load("csharp keyword"><strong><font color="#006699">object</font></strong> "csharp plain">sender, EventArgs e)</span></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">{</span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"></td> </tr> </tbody> </table> </div> <div class="line alt2"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">}</span></td> </tr> </tbody> </table> </div> <div class="line alt1"> <table> <tbody> <tr> <td class="content"><span style="background-color: #ffff99">"csharp plain">}</span></td> </tr> </tbody> </table> </div> </div> </div> </div> </div>
试试其它关键字
密码强度验证
同语言下
.
gzip压缩
.
实现http多线程断点续传下载文件
.
实现多线程断点续传下载大文件
.
生成字符串的 CheckSum
.
根据 UserAgent 获取浏览器的类型和版本
.
根据 Agent 判断是否是智能手机
.
隐藏手机号中间四位为*方法
.
合并图片(二维码和其他图片合并)
.
ASP.NET CORE中判断是否移动端打开网页
.
ASP.NET(C#)实现页面计时(定时)自动跳转
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
Dezai.CN
贡献的其它代码
(
4037
)
.
多线程Socket服务器模块
.
生成随机密码
.
清除浮动样式
.
弹出窗口居中
.
抓取url的函数
.
使用base HTTP验证
.
div模拟iframe嵌入效果
.
通过header转向的方法
.
Session操作类
.
执行sqlite输入插入操作后获得自动编号的ID
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3