default.asp

来自「ASP编写的一个公司网站的源程序」· ASP 代码 · 共 90 行

ASP
90
字号
<%@ Language=VBScript %>

<%
Option Explicit
Response.Buffer=true
%>
<%	response.expires = 0
	response.expiresabsolute = Now() - 1
	response.addHeader "pragma","no-cache"
	response.addHeader "cache-control","private"
	Response.CacheControl = "no-cache"
	Dim ErrMsg
	Dim UserName
	Dim UserID
	Dim Obj
	Dim mTypes
	Dim PassWord
%>
<%If Session("UserID")<>"" Then Response.Redirect "Admin.asp" End If%>
<!--#include file="../include/Const.asp"-->
<!--#include file="../include/DBConn.asp"-->
<!--#include file="../include/FuncPub.asp"-->

<%


  ErrMsg=""
  
  if Request("submit") = "确 定" then
    UserName=Request.Form("UserName")
    if ErrMsg="" then

      Dim IPCheck
      IPCheck=true
	  dim i
      if Login(ModifyInput(Request("UserName")),ModifyInput(Request("Password"))) then  
  
        Response.Redirect "Admin.asp"
'############################################################################        
    else
      ErrMsg = "用户名或密码错误,请重试!"  
    end if
  end if
end if
%>
<html>
<head>
<title><%=SITENAME%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="description" content=" ">
<meta name="keywords" content=" ">
<link rel="stylesheet" href="../Css/Css.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<p>&nbsp;</p>
<p>&nbsp;</p>
<form name="form1" method="post" action="Default.asp" ID="Form1">
  <table width="500" border="0" cellspacing="0" cellpadding="0" align="center" ID="Table1">
    <tr> 
      <td align="left" colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="/images/logo2.gif"></td>
    </tr>
    <tr valign="bottom"> 
      <td align="right" width="156" class="font" height="40">帐 号:</td>
      <td width="344"> 
        <input type="text" name="UserName" size="21" value="<%=Request.Cookies("UserName")%>" ID=Text2 width="153">
      </td>
    </tr>
    <tr> 
      <td align="right" width="156" class="font">密 码:</td>
      <td width="344"> 
        <input type="password" name="Password" size="21" value="<%If Request.Cookies("Password")<>"" then Response.Write Decrypt(Request.Cookies("PassWord")) End If%>" ID=Password1>
      </td>
    </tr>
    <tr> 
      <td align="center">&nbsp; </td>
      <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="Submit" value="确 定" ID="Submit1">&nbsp;&nbsp;&nbsp;<input type="reset" name="Submit2" value="重 填" ID="Reset1">
      </td>
    </tr>

  </table>
</form>
</body>
</html>

<!--#include file="../include/DBClose.asp"-->
<%if ErrMsg<>"" then%>
<script language="javascript">
    window.alert("<%=ErrMsg%>")
</script>
<%End if%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?