Big Gray Wolf's ASP toolbox-anti-leeching and determination of the day of the week

Source: Internet
Author: User
Tags servervariables
 
Anti-Leech
<%
Http = Request. ServerVariables ("HTTP_REFERER ")
Http2 = Cstr (Request. ServerVariables ("SERVER_NAME "))
If mid (http, 8, len (http2) <> http2 then
Response. write "this site cannot be downloaded from an external site! "
Else
Response. redirect "download.doc" 'download.doc is the download file name.
End if
%>
-------------------------------------------------------
Determine the day of the week
<%
Yue = month (date ())
Nian = year (date ())
Thismon = nian & "-" & yue & "-1"
Nextmon = dateadd ("m", 1, thismon)
Tiancount = datediff ("d", thismon, nextmon) 'Days of the month
Wek = Weekday (date ())
Select case wek
Case 1
Response. write "Sunday"
Case 2
Response. write "Monday"
Case 3
Response. write "Tuesday"
Case 4
Response. write "Wednesday"
Case 5
Response. write "Thursday"
Case 6
Response. write "Friday"
Case 7
Response. write "Saturday"
End select
Yue = month (date ())
Nian = year (date ())
Thismon = nian & "-" & yue & "-1"
Nextmon = dateadd ("m", 1, thismon)
Tiancount = datediff ("d", thismon, nextmon) 'Days of the month
Dim wek, wekday
Wek = Weekday (date ())
Select case wek
Case 1
Wekday = "Sunday"
Case 2
Wekday = "Monday"
Case 3
Wekday = "Tuesday"
Case 4
Wekday = "Wednesday"
Case 5
Wekday = "Thursday"
Case 6
Wekday = "Friday"
Case 7
Wekday = "Saturday"
End select
'Response. write "total for this month" & tiancount & "day, today is" & wekday &"
%>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.