大灰狼的ASP工具箱——防盜鏈、判斷星期幾

來源:互聯網
上載者:User
 
防盜鏈
<%
 http=Request.ServerVariables("HTTP_REFERER")
 http2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(http,8,len(http2))<>http2 then
     response.write "本站禁止從外部網站下載!"
else
     response.redirect "download.doc" 'download.doc為下載檔案名稱
end if
%>
-------------------------------------------------------
判斷星期幾
<%
yue=month(date())
nian=year(date())
 thismon=nian&"-"&yue&"-1"
 nextmon=dateadd("m",1,thismon)
 tiancount=datediff("d",thismon,nextmon)  '本月的天數
wek= Weekday(date())
select case wek
case 1
response.write "周日"
case 2
response.write "周一"
case 3
response.write "周二"
case 4
response.write "周三"
case 5
response.write "周四"
case 6
response.write "周五"
case 7
response.write "周六"
end select
yue=month(date())
nian=year(date())
 thismon=nian&"-"&yue&"-1"
 nextmon=dateadd("m",1,thismon)
 tiancount=datediff("d",thismon,nextmon)  '本月的天數
dim wek,wekday
wek= Weekday(date())
select case wek
case 1
wekday= "周日"
case 2
wekday= "周一"
case 3
wekday= "周二"
case 4
wekday= "周三"
case 5
wekday= "周四"
case 6
wekday= "周五"
case 7
wekday= "周六"
end select
'response.write "本月共"&tiancount&"天,今天是"&wekday&"
%>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.