asp生日自动提醒小程式

  1<html><head><title>同学生日提醒</title>
  2<style type="text/css">BODY {   
  3FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px; MARGIN-TOP: 0px   
  4}   
  5A {   
  6COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none   
  7}   
  8A:hover {   
  9COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline   
 10}   
 11A:active {   
 12COLOR: #ff0033; CURSOR: hand; FONT: 9pt "宋体"   
 13}   
 14</style>
 15<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
 16<script language="JavaScript">   
 17  
 18  
 19  
 20<!--   
 21  
 22function birthday(year,month,date,person) {   
 23this.year=year   
 24this.month=month   
 25this.date=date   
 26this.person=person   
 27}   
 28function birthdaylist() {   
 29}   
 30blist=new birthdaylist()   
 31blist[0]= new birthday(1933,2,14,"abc")   
 32blist[1]= new birthday(1933,12,17,"efs")   
 33//上面添加你朋友的生日列表   
 34var now=new Date()   
 35today=new Date(now.getYear(),now.getMonth(),now.getDate()) // today 0:00:00   
 36function daysFromToday(sdate) {   
 37return Math.round((sdate.getTime()-today.getTime())/(24*60*60*1000))   
 38}   
 39function writeNextBirthday(list) {   
 40var daysToClosest=888   
 41var closest   
 42for (var i in list) {   
 43thisDate=new Date(today.getYear(),list[i].month-1,list[i].date)   
 44if (daysFromToday(thisDate)<0)   
 45thisDate.setYear(today.getYear()+1)   
 46if (daysFromToday(thisDate)<daysToClosest) {   
 47daysToClosest=daysFromToday(thisDate)   
 48closest=i   
 49}   
 50}   
 51if (daysToClosest==0)   
 52document.write("<B>今天["+list[closest].person+"]"+"["+(today.getYear()-list[closest].year)+"]岁大寿!   
 53祝你生日快乐^0^</B>")   
 54else if (daysToClosest==1)   
 55document.write("明天["+list[closest].person+"]将过["+(today.getYear()-list[closest].year)+"]岁生日!")   
 56else   
 57document.write("你最近要过生日的朋友是["+list[closest].person+"]在["+daysToClosest+"]天后。")   
 58}   
 59// end hiding -->   
 60</script>
 61<meta content="MSHTML 5.00.2614.3500" name="GENERATOR"/></head>
 62<body bgcolor="#FFFFFF" onload="startclock ()">
 63<center>
 64<font color="red"><font color="#FF3333" size="5">同学生日提醒</font></font><font color="red" face="隶书" size="6"><br/>
 65</font> <font color="red" face="隶书" size="6"> </font>
 66</center>
 67<div align="center">
 68<hr color="#000000" noshade="" size="1"/>   
 69现在的日期时间是:   
 70<script language="JavaScript">   
 71today=new Date();   
 72function initArray(){   
 73this.length=initArray.arguments.length   
 74for(var i=0;i<this.length;i++)   
 75this[i+1]=initArray.arguments[i] }   
 76var d=new initArray(   
 77"星期日",   
 78"星期一",   
 79"星期二",   
 80"星期三",   
 81"星期四",   
 82"星期五",   
 83"星期六");   
 84document.write(   
 85"<font color=##000000 style='font-size:9pt;font-family: 宋体'> ",   
 86today.getYear(),"年",   
 87today.getMonth()+1,"月",   
 88today.getDate(),"日",   
 89d[today.getDay()+1],   
 90"</font>" );   
 91</script>
 92<br/>
 93<br/>
 94</div>
 95<center>
 96<table border="1" bordercolor="#000000" bordercolordark="#FFFFFF" cellpadding="0" cellspacing="0" width="502">
 97<tr bgcolor="#CCFFCC">
 98<td>
 99<div align="center"><font color="#FF3333"></font><font color="#FF3333" size="4">大   
100家 注 意 了</font></div>
101</td>
102</tr>
103<tr>
104<td>
105<div align="center">
106<script language="JavaScript">   
107<!--   
108writeNextBirthday(blist)   
109// -->   
110</script>
111</div>
112</td>
113</tr>
114</table>
115<br/>   
116\---97计算机---   
117</center>
118</body></html>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus