#T= 创建目录
<%
Function CreateFolder(strFolderName)
SET FSO=Server.CreateObject("Scripting.FileSystemObject")
IF(FSO.FolderExists(strFolderName) = False)THEN
FSO.CreateFolder(strFolderName)
END IF
SET FSO=NOTHING
END Function
%>
#T= 删除目录
<%
Function DeleteFolder(strFolderName)
SET FSO=Server.CreateObject("Scripting.FileSystemObject")
IF(FSO.FolderExists(strFolderName))THEN
FSO.DeleteFolder(strFolderName)
END IF
SET FSO=NOTHING
END Function
%>
#T= 判断文件是否存在
<%
Function IsFileExist(strFileName)
SET FSO=Server.CreateObject("Scripting.FileSystemObject")
IF(FSO.FileExists(strFileName))THEN
IsFileExist = True
ELSE
IsFileExist = False
END IF
SET FSO=NOTHING
End Function
%>
#T= 删除文件
<%
Function DeleteFile(strFileName)
SET FSO=Server.CreateObject("Scripting.FileSystemObject")
IF(FSO.FileExists(strFileName))THEN
FSO.DeleteFile(strFileName)
END IF
SET FSO=NOTHING
END Function
%>
#T=============================
#T= ASP小偷常用的几个函数
<%
Function ByteToStr(vIn)
Dim strReturn,i,ThisCharCode,innerCode,Hight8,Low8,NextCharCode
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
ByteToStr = strReturn
End Function
Function GetHttpPageContent(url,Method,SendStr)
Dim Retrieval
SET Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open Method, url, False ,"" ,""
.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
.Send(SendStr)
GetHttpPageContent = .ResponseBody
End With
SET Retrieval = Nothing
GetHttpPageContent=ByteToStr(GetHttpPageContent)
End Function
Function RegExpText(strng,regStr)
Dim regEx,Match,Matches,RetStr
SET regEx = New RegExp
regEx.Pattern = regStr
regEx.IgnoreCase = True
regEx.Global = True
SET Matches = regEx.Execute(strng)
For Each Match in Matches
RetStr = RetStr & regEx.Replace(Match.Value,"$1") & ","
Next
RegExpText = RetStr
set regEx=nothing
End Function
Function StreamBytesToBstr(strBody, CodeBase)
Dim objStream
SET objStream = Server.CreateObject("Adodb.Stream")
With objStream
.Type = 1
.Mode = 3
.Open
.Write strBody
.Position = 0
.Type = 2
.Charset = CodeBase
StreamBytesToBstr = .ReadText
.Close
End With
SET objStream = Nothing
End Function
%>