level 1
奋斗士007
楼主
谁呢读懂这段代码,给解释下,最好能给改下,闹成五个文件循环的
strJS="<SCRIPT language=javascript>" & vbcrlf
if FoundErr<>true then
randomize
ranNum=int(900*rnd)+100
filename=SavePath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt
ofile.SaveToFile Server.mappath(FileName) '保存文件
whichfile=server.mappath(""& fileName & "")
Set fso = CreateObject("Scripting.FileSystemObject")
set thisfile=fso.opentextfile(whichfile)
my_string=thisfile.readall
if instr(LCase(my_string),"<%")<>0 or instr(LCase(my_string),"<%")<>0 or instr(LCase(my_string),"Request")<>0 or instr(LCase(my_string),"Session")<>0 or instr(LCase(my_string),"script")<>0 then
dim muma
muma=1
Response.Write "<script language='javascript'>alert('同志,你上传木马病毒!');</script>"
'if FSO.fileExists(whichfile) then
'FSO.DeleteFile(whichfile)
'end if
Set thisfile = FSO.GetFile(whichfile)
thisfile.Delete True
set fso=nothing
end if
if muma<>1 then
Response.Write "<script language='javascript'>alert('图片上传成功!');</script>"
Response.Write "<a href=Upload1.asp>[重新上传]</a>"
strJS=strJS & "parent.document.myform.tupian.value='"& fileName & "';" & vbcrlf
else
strJS=strJS & "alert('" & msg & "');" & vbcrlf
strJS=strJS & "history.go(-1);" & vbcrlf
end if
strJS=strJS & "</script>" & vbcrlf
response.write strJS
end if
set file=nothing
next
set upload=nothing
end sub
%>
2014年12月31日 09点12分
1
strJS="<SCRIPT language=javascript>" & vbcrlf
if FoundErr<>true then
randomize
ranNum=int(900*rnd)+100
filename=SavePath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt
ofile.SaveToFile Server.mappath(FileName) '保存文件
whichfile=server.mappath(""& fileName & "")
Set fso = CreateObject("Scripting.FileSystemObject")
set thisfile=fso.opentextfile(whichfile)
my_string=thisfile.readall
if instr(LCase(my_string),"<%")<>0 or instr(LCase(my_string),"<%")<>0 or instr(LCase(my_string),"Request")<>0 or instr(LCase(my_string),"Session")<>0 or instr(LCase(my_string),"script")<>0 then
dim muma
muma=1
Response.Write "<script language='javascript'>alert('同志,你上传木马病毒!');</script>"
'if FSO.fileExists(whichfile) then
'FSO.DeleteFile(whichfile)
'end if
Set thisfile = FSO.GetFile(whichfile)
thisfile.Delete True
set fso=nothing
end if
if muma<>1 then
Response.Write "<script language='javascript'>alert('图片上传成功!');</script>"
Response.Write "<a href=Upload1.asp>[重新上传]</a>"
strJS=strJS & "parent.document.myform.tupian.value='"& fileName & "';" & vbcrlf
else
strJS=strJS & "alert('" & msg & "');" & vbcrlf
strJS=strJS & "history.go(-1);" & vbcrlf
end if
strJS=strJS & "</script>" & vbcrlf
response.write strJS
end if
set file=nothing
next
set upload=nothing
end sub
%>