1, check whether the file exists
Usage Example: If checkfile ("aa.jpg") = True Then Response.Write "OK"
Copy content to Clipboard program code
Function Checkfile (FileName)
On Error Resume Next
Dim Fsoobj
Set fsoobj = Server.CreateObject ("Scripting.FileSystemObject")
If not Fsoobj.fileexists (Server.MapPath (FileName)) Then
Checkfile = False
Exit Function
End If
Checkfile = True:set Fsoobj = Nothing
End Function
2. Detect the number of string occurrences
Parameter description: thechar= "string to detect", thestring= "string to be detected"
Usage Example: If Checkthechar ("A", "about") = 1 Then Response.Write "OK"
Copy content to Clipboard program code
Function Checkthechar (thechar,thestring)
If InStr (Thestring,thechar) Then
For n = 1 to Len (thestring)
If Mid (Thestring,n,len (TheChar)) = TheChar Then
Checkthechar = Checkthechar + 1
End If
Next
Checkthechar = Checkthechar
Else
Checkthechar = 0 ' "0 times"
End If
End Function
3, take the complete URL address
Copy content to Clipboard program code
Function GETURL ()
Dim scriptaddress, M_itemurl, M_item
Scrip taddress = CStr (Request.ServerVariables ("Script_name")) ' Get current address
M_itemurl = '
If (request.que Rystring <> "") Then
scriptaddress = scriptaddress & "?"
for all m_item in Request.QueryString
If InStr (Page,m_item) =0 Then
m_itemurl = m_itemurl & m_item & "=" & Server.urlencod E (Request.QueryString ("&M_Item&")) & "
end If
&nbs p; Next
End If
GETURL = scriptaddress & m_itemurl
End Function