中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档 | 网通镜像
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 程序开发 > Web开发 > Asp > 综合文章
向记事本里写入数据、一个修改密码的判断方法
作者:佚名 时间:2004-10-07 10:44 出处:互连网 责编:chinaitpower
              摘要:向记事本里写入数据、一个修改密码的判断方法
<%@language="Vbscript"%>
<% Response.Expires=0 %>
<% if Session("fz_login") = "8" then %>
<%
if Request.ServerVariables("HTTP_METHOD")="POST" And checkme<>"true" then
username=Request.Form("username")
password=Request.Form("password")
set fs=server.CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile(server.MapPath("userpw.asp"), 2, True)
f.writeline "<%"
f.writeline "P_username=" & chr(34) & username & chr(34)
f.writeline "P_password=" & chr(34) & password & chr(34)
f.writeline chr(37) & ">"
f.close
set f=nothing
set fs=nothing
session("logusername")=username
session("logpassword")=password
edit_ok
end if
%>
<%sub edit_ok()%>
<script language="javascript">
alert("您的用户名与密码已成功修改!");
document.location.href="welcome.htm";
</script>
<%end sub%>

<script language="javascript">
function checkform(){
if (document.form1.username.value==""){
alert("请输入新用户名,并不能为空!");
document.form1.username.focus();
return false;
}

if (document.form1.password.value==""){
alert("请输入新密码!");
document.form1.password.focus();
return false;
}

if (document.form1.username.value.length<6 || document.form1.password.value.length<6){
alert("为了网络安全,请输入大于6个字符的用户名和密码!");
document.form1.username.value="";
document.form1.password.value="";
document.form1.password1.value="";
return false;
}

if (document.form1.password1.value!=document.form1.password.value){
alert("您输入的密码不一致!");
document.form1.password1.focus();
document.form1.password1.value="";
return false;
}

if (confirm("您真的要修改密码吗?")==false){
document.location.href="welcome.htm";
return false;}
else
return true;

}
</script>
<html><head><title>修改密码</title>
<META NAME="robots" CONTENT="none">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="images/font.css" type="text/css">
</head>

<body bgcolor="#9CC7EF" leftMargin=0 marginwidth="0" topmargin=0>
<table width=530 border="0" cellspacing="0" cellpadding="0" align="center">
<tr align="center" bgcolor="<%=main_color%>">
<td>
<table width="100%" border="1" cellspacing="1" cellpadding="4" class="p9" bordercolorlight="#1059A5" bordercolordark="#9CC7EF">
<form name="form1" method="post" action="edit_pws.asp" onsubmit="javascript:return checkform();">
<tr>
<td height="40">
<div align="center" ><span style="font-size:14.9px"><b><font color="<%=maintitle_color%>">修
改 管 理 员 帐 号</font></b></span></div>
</td>
</tr>
<tr bgcolor="<%=textzero_color%>">
<td height="30" align="center"> 新用户名:<input type="text" name="username" size=30 class="p9">
</td>
</tr>
<tr bgcolor="<%=textzero_color%>">
<td align="center" height="30"> 新 密 码:<input type="password" name="password" size=30 class="p9">
</td>
</tr>
<tr bgcolor="<%=textzero_color%>">
<td align="center" height="30">验证密码:<input type="password" name="password1" size=30 class="p9">
</td>
</tr>
<tr height="30" bgcolor="<%=textzero_color%>">
<td align="center">
<input type="submit" name="Submit" value=" 保 存 " class="s02" style="height:27; width:82">
&nbsp;&nbsp;&nbsp;&nbsp
<input type="reset" name="close" value=" 取 消 " class="s02" style="height:27; width:82">
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</body>
</html>
<%else%>
<% response.redirect "login.asp" %>
<%end if%>


关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有