⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setup.asp

📁 一个超市管理系统
💻 ASP
字号:
<%


datapath="database/"  '数据库目录的相对路径
datafile=""&datapath&"#bbsxp.mdb"  '数据库的文件名(默认:#bbsxp.mdb)
Server.ScriptTimeout=30  '连接超时最大时间



ver="2.05"
startime=timer()
if ""&Request.Cookies("eremite")&""="" then
Response.Cookies("eremite")="0"
Response.Cookies("eremite").Expires=date+3650
response.write "<script>if(self!=top){top.location=self.location;}</script><meta HTTP-EQUIV=REFRESH CONTENT=3>登陆中...<br><br>本系统要求使用COOKIES, 如果您的浏览器禁用COOKIES, 您将不能登录本系统..."
response.end
end if


if cstr(Request.Cookies("now"))>cstr(now-0.00001) then
Response.Cookies("now")=now
response.write "<meta HTTP-EQUIV=REFRESH CONTENT=3>Loading..."
response.end
end if
Response.Cookies("now")=now

remoteaddr=Request.ServerVariables("REMOTE_ADDR")

Set Conn=Server.CreateObject("ADODB.Connection")
Connstr="DBQ="&server.mappath(datafile)&";DRIVER={Microsoft Access Driver (*.mdb)};"
Conn.Open Connstr
Set rs = Server.CreateObject("ADODB.Recordset")

rs.Open "clubconfig",Conn
clubname=rs("clubname")
cluburl=rs("cluburl")
associatortol=rs("associatortol")
newassociator=rs("newassociator")
administrators=rs("administrators")
adminpassword=rs("adminpassword")
homeurl=rs("homeurl")
homename=rs("homename")
affichetitle=rs("affichetitle")
affichecontent=rs("affichecontent")
affichetime=rs("affichetime")
afficheman=rs("afficheman")
badwords=rs("badwords")
badip=rs("badip")
allclass=rs("allclass")
selectmail=rs("selectmail")
smtp=rs("smtp")
smtpmail=rs("smtpmail")
MailServerusername=rs("MailServerusername")
MailServerPassword=rs("MailServerPassword")
SendPassword =rs("SendPassword")
rs.close


filtrate=split(badip,"|")
for i = 0 to ubound(filtrate)
if instr(remoteaddr,""&filtrate(i)&"") > 0 then
response.redirect "badip.htm"
end if
next

Set rs1 = Server.CreateObject("ADODB.Recordset")

dim userface,membercode,newmessage,succtitle
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function HTMLEncode(fString)
fString =server.htmlencode(Trim(fString))
fString = replace(fString, "'", "")
fString = replace(fString, " ", "&nbsp;")
HTMLEncode = fString
end function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sub top
if Request.Cookies("username")<>"" then
Set us = Server.CreateObject("ADODB.Recordset")
sql="select * from user where username='"&HTMLEncode(Request.Cookies("username"))&"'"
us.Open sql,Conn,1,3
on error resume next  '找不到用户资料时候忽略错误
if Request.Cookies("userpass")<>us("userpass") then
Response.Cookies("username")=""
Response.Cookies("userpass")=""
end if
userface=""&us("userface")&""
membercode=us("membercode")
newmessage=us("newmessage")
''''''''''''''''''第一次来'''''''''''''''''''''''''''''
if ""&Request.Cookies("onlinetime")&""="" then
us("degree")=us("degree")+1
us("landtime")=now
us.update
Response.Cookies("onlinetime")=now
Response.Cookies("addmin")=0
''''''''如果停留10分钟:经验值: +1 体力值:+10''''''''''''''''''''
elseif DateDiff("s",Request.Cookies("onlinetime"),Now())>600 then
us("experience")=us("experience")+1
us("landtime")=now
if us("userlife")>90 then
us("userlife")=100
else
us("userlife")=us("userlife")+10
end if
us.update
Response.Cookies("onlinetime")=now
Response.Cookies("addmin")=Request.Cookies("addmin")+10
end if
us.close
set us=nothing
''''''''''''''''''''''''''''
end if
%>
<html>

<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<link href="images/skins/<%=Request.Cookies("skins")%>/bbs.css" rel="stylesheet">
<link href="images/ybb.ico" rel="SHORTCUT ICON">
<base onmouseover="window.status='<%=clubname%> <%=cluburl%>';return true">
<body topmargin="0">
<script src="images/ybb.js"></script>
<script src="images/bbs.js"></script>
<SCRIPT>
document.write("<DIV id=yuzi style='right:25px;TOP:1px;POSITION:absolute;'><a href='javascript:history.back()' title='后退'><img border=0 src='images/bbsclose.gif'></a></div>");
lastScrollY=0;
function heartBeat(){
diffY=document.body.scrollTop;
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.all.yuzi.style.pixelTop+=percent;
lastScrollY=lastScrollY+percent;
}
window.setInterval("heartBeat()",1);
</script>
<table cellspacing="1" cellpadding="1" width="97%" align="center" border="0" class="a2">
  <tr>
    <td class="a1" width="80%">
    <table cellspacing="0" cellpadding="4" width="100%" border="0">
      <tr>
        <td width="80%"><font color="#ffffff">&gt;&gt;欢迎您,</font> <%
if Request.Cookies("username")="" then
%><font color="#ffffff"> <a href="login.asp"><font color="#FFFFFF">请先登陆</font></a> 
        | <a href="register.asp"><font color="#FFFFFF">注册</font></a> |
        <a href="modification.asp"><font color="#FFFFFF">忘记密码</font></a> |
        <a href="online.asp"><font color="ffffff">在线人员</font></a> |
        <a href="search.asp?forumid=<%=Request("forumid")%>">
        <font color="#ffffff">搜索</font></a> | <a href="help.asp">
        <font color="#ffffff">帮助</font></a> </font></td>
      </tr>
    </table>
    </td>
  </tr>
</table>
<br>
<%else%><%=Request.Cookies("username")%> <font color="#ffffff">
<a href="login.asp"><font color="#FFFFFF">更换用户</font></a> <%
if Request.Cookies("eremite")=0 then
response.write " | <A title=改变当前状态 href=cookies.asp?menu=eremite><FONT color=#FFFFFF>隐身</FONT></A>"
else
response.write " | <A title=改变当前状态 href=cookies.asp?menu=online><FONT color=#FFFFFF>上线</FONT></A>"
end if
%> | <a title="编辑您的个人资料" href="usercp.asp"><font color="#FFFFFF">控制面板</font></a> 
| <a title="查看在线会员资料" href="online.asp"><font color="ffffff">在线人员</font></a> |
<a href="search.asp?forumid=<%=Request("forumid")%>"><font color="#ffffff">搜索</font></a> 
| <a href="help.asp"><font color="#ffffff">帮助</font></a> <%
select case membercode
case "5"
response.write " | <A href=admin.asp target=_top><FONT color=ffffff>管理</FONT></A> | <A href=recycle.asp><FONT color=ffffff>回收站</FONT></A>"
case "4"
response.write " | <A href=recycle.asp><FONT color=ffffff>回收站</FONT></A>"
end select
%></td><td class="a1" align="right"><font color="000000">已经停留 <font color="red">
<%=DateDiff("n",Request.Cookies("onlinetime"),Now())+Request.Cookies("addmin")%></font> 
分钟 &nbsp; </td>
</tr>
</table>
</td>
</tr>
</table>
<%
'''''如果有短讯息''''''''''''''''''''''
if newmessage>0 then
%>
<bgsound src="images/msg.wav">
<table width="97%" align="center">
  <tr>
    <td width="100%" align="right">
    <a style="text-decoration: none" href="message.asp">
    <img src="images/newmail.gif" border="0"> <font color="990000">您有<%=newmessage%>条短讯息,请注意查收</font></a>
    </td>
  </tr>
</table>
<script>
if (getCookie('newmessage')=='1'){
if (confirm("你有新的短消息,是否打开收件箱查看?"))open('friend.asp?menu=look','','width=320,height=170');
}
</script>
<%
else
response.write "<br>"
end if
'''''''''''''
end if

end sub
''''''''''''''''''''''''''''''''
sub succeed(message)
top
%><title><%=succtitle%></title><table width="97%" align="center" border="0">
  <tr>
    <td valign="top" width="29%"><img src="images/logo.gif" border="0"></td>
    <td width="71%" align="top" valign="center">&nbsp;<font color="#000000"><img src="images/closedfold.gif" width="14" height="14"> <a href=Default.asp?menu=listtitle><%=clubname%></a><br>
&nbsp;<img height="15" src="images/coner.gif" width="15"><img src="images/openfold.gif"> <%=succtitle%>
    </font></td>
  </tr>
</table>
<br>
<table cellspacing="0" cellpadding="0" width="97%" align="center" border="0" class="a2">
  <tr>
    <td height="106">
    <table cellspacing="1" cellpadding="6" width="100%" border="0">
      <tr>
        <td width="100%" height="20" align="middle" class="a1">
        <font color="#000000"><b>状态:<%=succtitle%></b></font></td>
      </tr>
      <tr bgcolor="#ffffff">
        <td valign="top" align="left" height="122"><b>&nbsp;</b><table cellspacing="0" cellpadding="5" width="100%" border="0">
          <tr>
            <td width="83%" valign="top"><b><span id="yu">3</span><a href="javascript:countDown"></a>秒钟后系统将自动返回...</b><ol>
              <%=message%></ol>
            </td>
            <td width="17%"><img height="97" src="images/succ.gif" width="95"></td>
          </tr>
        </table>
        </td>
      </tr>
    </table>
    </td>
  </tr>
</table>
</font>
<script>function countDown(secs){yu.innerText=secs;if(--secs>0)setTimeout("countDown("+secs+")",1000);}countDown(3);
</script>
<%
htmlend
end sub
''''''''''''''''''''''''''''''
sub error(message)
top
%><title>错误信息</title><table width="97%" align="center" border="0">
  <tr>
    <td valign="top" width="29%"><img src="images/logo.gif" border="0"></td>
    <td width="71%" align="top" valign="center">&nbsp;<font color="#000000"><img src="images/closedfold.gif" width="14" height="14"> <a href=Default.asp?menu=listtitle><%=clubname%></a><br>
&nbsp;<img height="15" src="images/coner.gif" width="15"><img src="images/openfold.gif"> 错误::::错误信息:::</font></td>
  </tr>
</table>
<br>
<table cellspacing="0" cellpadding="0" width="97%" align="center" border="0" class="a2">
  <tr>
    <td height="106">
    <table cellspacing="1" cellpadding="6" width="100%" border="0">
      <tr>
        <td width="100%" height="20" colspan="2" align="middle" class="a1">
        <font color="#000000"><b>错误::::错误信息:::</b></font></td>
      </tr>
      <tr bgcolor="#ffffff">
        <td valign="top" align="left" colspan="2" height="122"><b>&nbsp;</b><table cellspacing="0" cellpadding="5" width="100%" border="0">
          <tr>
            <td width="83%" valign="top"><b>关于错误的可能原因:</b><ol>
              <%=message%></ol>
            </td>
            <td width="17%"><img height="97" src="images/err.gif" width="95"></td>
          </tr>
        </table>
        </td>
      </tr>
      <tr align="middle" bgcolor="#ffffff">
        <td valign="center" colspan="2" height="2">
        <input onclick="history.back(-1)" type="submit" value=" &lt;&lt; 返 回 上 一 页 " name="Submit">
        </td>
      </tr>
    </table>
    </td>
  </tr>
</table>
<%
htmlend
end sub
sub error2(message)
%><meta http-equiv="Content-Type" content="text/html;charset=gb2312"><p>
<script>alert('<%=message%>');history.back();</script>
<script>window.close();</script>
<%
responseend
end sub
''''''''''''''''''''''''''''''
sub htmlend
%></p>
<p><br>
</p>
<table cellspacing="0" cellpadding="0" width="390" align="center" class="a2" border="0">
  <tr>
    <td>
    <table cellspacing="1" cellpadding="6" width="390" border="0">
    </table>
    </td>
  </tr>
</table>
<br>
<table cellspacing="0" cellpadding="0" width="97%" align="center">
  <tr>
    <td align="middle">本论坛言论纯属发表者个人意见,与<font color="#990000"><b>
    <a target="_blank" href="<%=homeurl%>"><%=homename%></a> </b></font>立场无关 <br>
    BBSXP <a target="_blank" href="http://www.yuzi.net"><font color="#000000">Yuzi工作室</font></a> 
    版权所有   <a target="_blank" href="http://www.bbsxp.com/download.asp?ver=<%=ver%>">
    <font color="#000000">BBSXP Ver <%=ver%></font></a><br>
    页面执行时间:<%=(timer()-startime)*1000%> 毫秒</td>
  </tr>
</table>
</font>




</body>
</html>
<%
responseend
end sub


sub responseend
Conn.close
set rs=nothing
set rs1=nothing
set conn=nothing
response.end
end sub
%>

⌨️ 快捷键说明

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