asp生日自动提醒小程式
程序员文章站
2022-06-22 13:46:20
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>同学生日提醒</TITLE>
<STYLE type=text/css>BODY {
FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px; MARGIN-TOP: 0px
}
A {
COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none
}
A:hover {
COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline
}
A:active {
COLOR: #ff0033; CURSOR: hand; FONT: 9pt "宋体"
}
</STYLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<SCRIPT language=JavaScript>
<!--
function birthday(year,month,date,person) {
this.year=year
this.month=month
this.date=date
this.person=person
}
function birthdaylist() {
}
blist=new birthdaylist()
blist[0]= new birthday(1933,2,14,"abc")
blist[1]= new birthday(1933,12,17,"efs")
//上面添加你朋友的生日列表
var now=new Date()
today=new Date(now.getYear(),now.getMonth(),now.getDate()) // today 0:00:00
function daysFromToday(sdate) {
return Math.round((sdate.getTime()-today.getTime())/(24*60*60*1000))
}
function writeNextBirthday(list) {
var daysToClosest=888
var closest
for (var i in list) {
thisDate=new Date(today.getYear(),list[i].month-1,list[i].date)
if (daysFromToday(thisDate)<0)
thisDate.setYear(today.getYear()+1)
if (daysFromToday(thisDate)<daysToClosest) {
daysToClosest=daysFromToday(thisDate)
closest=i
}
}
if (daysToClosest==0)
document.write("<B>今天["+list[closest].person+"]"+"["+(today.getYear()-list[closest].year)+"]岁大寿!
祝你生日快乐^0^</B>")
else if (daysToClosest==1)
document.write("明天["+list[closest].person+"]将过["+(today.getYear()-list[closest].year)+"]岁生日!")
else
document.write("你最近要过生日的朋友是["+list[closest].person+"]在["+daysToClosest+"]天后。")
}
// end hiding -->
</SCRIPT>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR></HEAD>
<BODY onLoad="startclock ()" bgColor=#FFFFFF>
<CENTER>
<font color="red"><font color="#FF3333" size="5">同学生日提醒</font></font><FONT color=red face=隶书
size=6><br>
</FONT> <FONT color=red face=隶书 size=6> </FONT>
<HTML><HEAD><TITLE>同学生日提醒</TITLE>
<STYLE type=text/css>BODY {
FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px; MARGIN-TOP: 0px
}
A {
COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none
}
A:hover {
COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline
}
A:active {
COLOR: #ff0033; CURSOR: hand; FONT: 9pt "宋体"
}
</STYLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<SCRIPT language=JavaScript>
<!--
function birthday(year,month,date,person) {
this.year=year
this.month=month
this.date=date
this.person=person
}
function birthdaylist() {
}
blist=new birthdaylist()
blist[0]= new birthday(1933,2,14,"abc")
blist[1]= new birthday(1933,12,17,"efs")
//上面添加你朋友的生日列表
var now=new Date()
today=new Date(now.getYear(),now.getMonth(),now.getDate()) // today 0:00:00
function daysFromToday(sdate) {
return Math.round((sdate.getTime()-today.getTime())/(24*60*60*1000))
}
function writeNextBirthday(list) {
var daysToClosest=888
var closest
for (var i in list) {
thisDate=new Date(today.getYear(),list[i].month-1,list[i].date)
if (daysFromToday(thisDate)<0)
thisDate.setYear(today.getYear()+1)
if (daysFromToday(thisDate)<daysToClosest) {
daysToClosest=daysFromToday(thisDate)
closest=i
}
}
if (daysToClosest==0)
document.write("<B>今天["+list[closest].person+"]"+"["+(today.getYear()-list[closest].year)+"]岁大寿!
祝你生日快乐^0^</B>")
else if (daysToClosest==1)
document.write("明天["+list[closest].person+"]将过["+(today.getYear()-list[closest].year)+"]岁生日!")
else
document.write("你最近要过生日的朋友是["+list[closest].person+"]在["+daysToClosest+"]天后。")
}
// end hiding -->
</SCRIPT>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR></HEAD>
<BODY onLoad="startclock ()" bgColor=#FFFFFF>
<CENTER>
<font color="red"><font color="#FF3333" size="5">同学生日提醒</font></font><FONT color=red face=隶书
size=6><br>
</FONT> <FONT color=red face=隶书 size=6> </FONT>
下一篇: PHP删除文件夹及文件夹下的所有文件