虚拟主机域名注册-常见问题网络编程问题 → ASP


ASP程序显示星期,日期,时间!并显示不同的问候语
作者:
<%
xiqi=weekday(now)
if xiqi=2 then
xiqi="一"
wenhouyu="今天星期一啦"
elseif xiqi=3 then
xiqi="二"
wenhouyu="今天星期二啦"
elseif xiqi=4 then
week="三"
wenhouyu="今天星期三啦"
elseif xiqi=5 then
xiqi="四"
wenhouyu="今天星期四啦"
elseif xiqi=6 then
xiqi="五"
wenhouyu="今天星期五啦"
elseif xiqi=7 then
xiqi="六"
wenhouyu="今天星期六啦"
elseif xiqi=1 then
xiqi="日"
wenhouyu="今天星期天啦"
end if
 
hours=hour(now)
if hours > 5 and hours < 11 then
hours="早上好!"
elseif hours > 11 and hours < 13 then
hours="中午好!"
elseif hours > 13 and hours < 16 then
hours="下午好!"
elseif hours > 16 and hours < 18 then
hours="傍晚好!"
elseif hours > 18 and hours < 23 then
hours="晚上好!"
elseif hours > 23 or hours < 5 then
hours="深更半夜的 该睡觉了!"
end if
 
if xiqi="一" then
response.write year(now)&"年"&month(now)&"月"&day(now)&"日 星期"&xiqi&" "&wenhouyu&" "&hour(now)&"点"&minute(now)&"分"&second(now)&"秒   "
response.write hours
Response.End()
else
 
if xiqi="二" then
response.write year(now)&"年"&month(now)&"月"&day(now)&"日 星期"&xiqi&" "&wenhouyu&" "&hour(now)&"点"&minute(now)&"分"&second(now)&"秒   "
response.write hours
Response.End()
.....
后面的自己依次类推
end if
end if
%>




来源:
阅读:1980
日期:2016-08-14

推荐朋友 】 【 评论 】  【 字体: 】 
上一篇:网页显示早上好,中午好,下午好等问候语句js
下一篇:css 圆形角代码
  >> 相关文章
 
发表评论


点  评: 字数0
用户名:  密码:

  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款