浏览模式: 正常浏览 | 列表浏览
四月, 2006 | < | 1 | 2 | 3 | 4 | 5 | >

一个简单的ASP后台登录程序

[ 2006-04-30 11:12:42 | 作者: kite ]
一个简单的ASP后台登录程序
点此下载

然后在后台的每一个页面加多以下代码,防止不用帐号和密码就可以登录。
<%
' 检查 Cookie 中的 Passed 变量是否等于 Passed
If Not Request.Cookies("Passed")="Passed" Then
Response.Redirect "admin.asp"
Response.End
End If
%>
<DIV id=jnkc></DIV>
<SCRIPT>setInterval("jnkc.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt (new Date().getDay());",1000);</SCRIPT>
<SCRIPT language=javascript>
<!--
calendar = new Date();
day = calendar.getDay();
month = calendar.getMonth();
date = calendar.getDate();
year = calendar.getYear();
if (year< 100) year = 1900 + year;
cent = parseInt(year/100);
g = year % 19;
k = parseInt((cent - 17)/25);
i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19*g + 15) % 30;
i = i - parseInt(i/28)*(1 - parseInt(i/28)*parseInt(29/(i+1))*parseInt((21-g)/11));
...

阅读全文

ASP中动态时间显示

[ 2006-04-27 17:19:37 | 作者: kite ]
<Script language="VBscript">
SetTimeOut "Clock",1000
Sub Clock()
StrNowTime=now()
NowT.InnerHtml=StrNowTime
SetTimeOut "Clock",1000
End Sub
</Script>
<Center id="NowT"></Center>

计数器

[ 2006-04-27 13:37:41 | 作者: kite ]
文件一:GLOBAL.ASA
<SCRIPT LANGUAGE=VBScript RUNAT=Server>

Sub Application_onStart
Application("OnLine") = 0
End Sub


Sub Session_onStart
Application.Lock
Application("OnLine") = Application("OnLine") + 1
Application.Unlock
End Sub

</SCRIPT>

文件二:COUNTER.ASP

<%@language=VBscript%>
<Html>
<head>
<title>
防止刷新的计数器
</title>
</head>
<body>
<center>
<font color=blue size=5>
...

阅读全文

整理了一些ASP初学者常用的代码

[ 2006-04-27 13:20:37 | 作者: kite ]
1.获得系统时间:
<%=now()%>
2.取得来访用的IP:
<%=request.serverVariables("remote_host")%>
3.获得系统,浏览器版本:
<script>
window.document.write("版本:"+navigator.appName+navigator.appVersion+" browser.")
</script>
4.去除IE混动条:
<body scroll="no">
<body style="overflow-y:hidden">
5.进入网站,跳出广告:
<script language="javascript">
<!--
<!-- 注意更改文件所在路径-->
window.open(''http://www.XXXXXX.com&#39;&#39;,&#39;&#39;&#39;&#39;,&#39;&#39;height=200,width=300,top=0,left=30&#39;&#39;);
...

阅读全文

SQL语句参考及记录集对象详解

[ 2006-04-27 13:18:37 | 作者: kite ]
1. ASP与Access数据库连接:

<%@ language=VBscript%>
<%
dim conn,mdbfile
mdbfile=server.mappath("数据库名称.mdb")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};uid=admin;pwd=数据库密码;dbq="&mdbfile

%>

2. ASP与SQL数据库连接:

<%@ language=VBscript%>
<%
dim conn
set conn=server.createobject("ADODB.connection")
con.open "PROVIDER=SQLOLEDB;DATA ...

阅读全文

倒计时间代码

[ 2006-04-27 13:16:39 | 作者: kite ]
倒计时一
<%@ Language=VBScript %>
<%
response.write "今天是"
response.write formatDateTime(Date(),1) & ","
'格式化为长日期格式输出显示
response.write " 离高考还有"
response.write "<font color=blue><u>"
'调用DateDiff函数,计算日期间隔.
response.write DateDiff("d",Date(),"08-06-07")
response.write "</font></u>"
response.write "天"
%>

倒计时二
<!-- 倒记时 start -->
...

阅读全文