ASP Force Refresh Web page and determine file address

Source: Internet
Author: User
Tags chr

Force Refresh Page

<%
 ’强制性刷新随机验证码
 ’让随机验证码每次按IE的后退按钮时,返回登录页面的随即码都自动刷新,
 Response.expires=-1
 Response.AddHeader"pragma","no-cache"
 Response.AddHeader"cache-control","no-store"
%>

Determine if the file address is valid

<%
' Original author: Xiao Yi qq:52093 time: 2005.6.30
Response.Write ("")
On Error Resume Next
Dim Thisurl,thistext
Thisurl=request ("Thisurl") ' defines the file address (non-HTML format document)!
If Thisurl= "" Then
Response.Write ("Please enter the 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
objXmlHttp = 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 If
End Function
Function Bytes2bstr (vIn)
Strreturn = ""
For i = 1 to LenB (vIn)
Thischarcode = 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 (nextcharcode))
i = i + 1
End If
Next
Bytes2bstr = Strreturn
End Function
Thisurl2=split (Thisurl, ",")
For all 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
%>

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.