function.asp
上传用户:rblchem
上传日期:2022-04-27
资源大小:1941k
文件大小:2k
- <%
- Function Readfile(Loadfrom)
- Set objStream = Server.CreateObject("ADODB.Stream")
- With objStream
- .Type = 2
- .Mode = 3
- .Open
- .Charset="utf-8"
- .Position = objStream.Size
- .LoadFromFile Loadfrom
- Readfile=.ReadText
- .Close
- End With
- Set objStream=nothing
- End Function
- Function Savefile(Saveto,SaveStr)
- Set objStream = Server.CreateObject("ADODB.Stream")
- With objStream
- .Type = 2
- .Mode = 3
- .Open
- .Charset = "utf-8"
- .Position = objStream.Size
- .WriteText=SaveStr
- .SaveToFile Saveto,2
- .Close
- End With
- Set objStream = NoThing
- End Function
- Function ReplaceStr(source,para,str)
- Set objRegExp=New RegExp
- objRegExp.IgnoreCase =True
- objRegExp.Global=True
- objRegExp.Pattern=para
- ReplaceStr= objRegExp.Replace(source,str)
- Set objRegExp=Nothing
- End Function
- Function RegExpTest(patrn,strng)
- Dim regEx, retVal ' 建立变量。
- Set regEx = New RegExp ' 建立正则表达式。
- regEx.Pattern = patrn ' 设置模式。
- regEx.Global=True
- regEx.IgnoreCase = True ' 设置是否区分大小写。
- RegExpTest = regEx.Test(strng) ' 执行搜索测试。
- End Function
- Function FilterSQL(strSQL)
- If not isnull(strSQL) then
- strSQL=CStr(Replace(strSQL,chr(39),"'"))
- FilterSQL=CStr(Replace(strSQL,chr(34),"""))
- end if
- End Function
- Function FilterSQL2(strSQL)
- If not isnull(strSQL) then
- FilterSQL2=CStr(Replace(strSQL,chr(39),chr(39)&chr(39)))
- end if
- End Function
- Function Formattimea(Stime)
- If isdate(Stime) then
- Formattimea=formatdatetime(Stime,2)&" "&formatdatetime(Stime,4)
- end if
- End Function
- %>