Recommended: ASP setting tips for using FCKEditor 1. Open the fckconfig.js file in the default language (relative to the FCKeditor folder, the same below), change the automatic detection language to non-detection, and change the default language to Simplified Chinese: Program code FCKConfig.AutoDetectLanguage = false ; FCKConfig.DefaultLanguage = 'zh-cn' ; 2. Open the fckconfig.js file in the font list, in the font list
<% '=================================================================
' Compiled by: Zhang Hui
' Programmer code: WJ008
' Compilation time: June 1, 2008
'Follow address: www.wj008.net
' All file addresses used by functions use absolute addresses
'================================================================================================
'LoadFile(ByVal File) Loads the existing file and generates a string to return the content of the file.
'SaveToFile(ByVal strBody,ByVal File) Save the changed file, strBody is the new string
'DelFile(ByVal File) Delete existing files
'Load the existing file, File is the file path
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Function LoadFile(ByVal File)
Dim objStream
On Error Resume Next
Set objStream = Server.CreateObject(ADODB.Stream)
If Err.Number=-2147221005 Then
Response.Write Unfortunately, your host does not support ADODB.Stream and cannot use this program
Err.Clear
Response.End
End If
With objStream
.Type = 2
.Mode = 3
.Open
.LoadFromFile File
If Err.Number<>0 Then
Response.Write file &File& cannot be opened, please check if it exists!
Err.Clear
Response.End
End If
.Charset = GB2312
.Position = 2
LoadFile = .ReadText
.Close
End With
Set objStream = Nothing
End Function
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Function SaveToFile(ByVal strBody,ByVal File) 'Save the open file, File is the saved file path, strBody is the saved content
Dim objStream
On Error Resume Next
Set objStream = Server.CreateObject(ADODB.Stream)
If Err.Number=-2147221005 Then
Response.Write <div align='center'>Sadly, your host does not support ADODB.Stream, and you cannot use this program</div>
Err.Clear
Response.End
End If
With objStream
.Type = 2
.Open
.Charset = GB2312
.Position = objStream.Size
.WriteText = strBody
.SaveToFile File,2
.Close
End With
Set objStream = Nothing
End Function
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Function DelFile(ByVal File)
Dim objFilesys
On Error Resume Next
Set objFilesys=server.createobject(scripting.filesystemobject)
If objFilesys.FILEExists(File) then 'If the file exists, delete it FILE as the file path
objFilesys.deleteFILE File
End if
If Err.Number<>0 Then
Response.Write file &File& cannot be deleted, the file may be in use by the system!
Err.Clear
Response.End
End If
Set objFilesys=nothing
End Function
'Check if the file exists
Function CheckFile(sFileName)
CheckFile=false
Dim objFilesys
On Error Resume Next
Set objFilesys=server.createobject(scripting.filesystemobject)
If objFilesys.FILEExists(sFileName) then 'If the file exists, delete it FILE as the file path
CheckFile=true
End if
Set objFilesys=nothing
End function
'Check if the folder exists
Function CheckFolder(Chk_Path)
set fso = server.createobject(scripting.filesystemobject)
if fso.FolderExists(Chk_Path)=false then
CheckFolder=false
else
CheckFolder=true
end if
End function
'Get the file suffix name
function GetFileExt(sFileName)
GetFileExt = UCase(Mid(sFileName,InStrRev (sFileName, .)+1))
End function
'************************************************************
'Function: ASP upload vulnerability/0 protection
'Function name: TrueStr(fileTrue)
'Parameters: sFileName Filename
'Return value: Return True for legal file, otherwise return False
'************************************************************
function IsTrueFileName(sFileName)
dim str_len,pos
str_len=len(sFileName)
pos=Instr(sFileName,chr(0))
If pos=0 or pos=str_len then
IsTrueFileName = true
else
IsTrueFileName = false
End If
End function
'************************************************************
'Function: Detect whether the uploaded image file (jpeg, gif, bmp, png) is really an image
'Function name: TrueStr(fileTrue)
'Parameters: sFileName file name (here the file name is the physical full path of the folder)
'Return value: If it is indeed an image file, it will return True, otherwise it will return False
'************************************************************
Function IsImgFile(sFileName)
const adTypeBinary=1
dim return
dim jpg(1):jpg(0)=CByte(&HFF):jpg(1)=CByte(&HD8)
dim bmp(1):bmp(0)=CByte(&H42):bmp(1)=CByte(&H4D)
dim png(3):png(0)=CByte(&H89):png(1)=CByte(&H50):png(2)=CByte(&H4E):png(3)=CByte(&H47)
dim gif(5):gif(0)=CByte(&H47):gif(1)=CByte(&H49):gif(2)=CByte(&H46):gif(3)=CByte(&H39):gif(4)=CByte(&H38):gif(5)=CByte(&H61)
on error resume next
Share: Database interface for domain name query asp version % on error resume next PRivate d_exsit Dim Retrieval Dim Domain Dim TakenHTML Function GetURL(url) Set Retrieval = Server.CreateObject(Microsoft.xmlHTTP) With Retrieval .Open GET, url, False, , .Send GetURL = .ResponseText End With Set Retrieval = N
3 pages in total Previous page 123 Next page