ASP Force Refresh Web page and judge file address instance code _ Application Tips

Source: Internet
Author: User

Force Refresh Page

<%
' mandatory refreshing random authentication code
' allows random authentication code to press IE's Back button each time, returns the login page the immediately code automatically refreshes,
response.expires=-1
Response.AddHeader " Pragma "," No-cache "
Response.AddHeader" Cache-control "," No-store "
%>

Determine if the file address is valid

<% Response.Write ("") on Error Resume Next Dim thisurl,thistext thisurl=request ("Thisurl") ' Define file address (non-HTML format document)!
  If Thisurl= "" Then Response.Write ("Please enter file address first!")
  Response.End End If Function objxmlhttp (xmlurl) on Error Resume Next Set objxml = CreateObject ("Microsoft.XMLHTTP") Objxml. Open "Get", Xmlurl,false Objxml.setrequestheader "Content-type", "application/x-www-form-urlencoded" Objxml.send OBJX Mlhttp = Objxml.responsebody If Err then Err.Clear Response.Write ("Failed to establish connection, file does not exist or network problem!; Error reason: "&Err.Description&"! ") Response.End end-function function Bytes2bstr (VIN) Strreturn =" For i = 1 to LenB (VIN) Thischarc
    Ode = AscB (MidB (vin,i,1)) If Thischarcode < &h80 Then Strreturn = strreturn & Chr (Thischarcode) Else Nextcharcode = AscB (MidB (vin,i+1,1)) Strreturn = Strreturn & Chr (CLng (thischarcode) * &h100 + CInt (nextcha Rcode)) i = i + 1 end If Next bytes2bstr = Strreturn End Function Thisurl2=split (Thisurl, ",") for each II in Thisurl2 THISTEXT=BYTES2BSTR (objXmlHttp (ii)) if INSTR (Thistext, "") <>0 Then Response.Write ("" & II & "X") Else Response.Write ("" & II & "√") End If Next if Err then err . Clear Response.Write ("met the accident!; Error reason: "&Err.Description&"! ") Response.End End If%>

The above is an ASP forced to refresh the Web page and judge the file address instance code, I hope to help you learn.

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.