高手进来挑战下,

lchacker 2010-04-23 07:38:47
高手来挑战下你的技术,看看一下代码那里有问题:
<%
' 忽略所有错误
on error resume next
Server.ScriptTimeOut = 1800
dim constPath,mypath
mypath=server.mappath("WAP2_Upfile.asp")
constPath=replace(mypath,"WAP2_Upfile.asp","")
dim upload,oFile,formName,SavePath,filename,fileExt,oFileSize,sizes
dim EnableUpload
dim arrUpFileType
dim ranNum
dim msg,FoundErr,MaxFileSize
MaxFileSize=""&bbsupsize&""'最大上传文件,以KB为单位
msg=""
FoundErr=false
EnableUpload=true
dim strMonth,strDay
dim tid,action,bbsid,title,content,content1,content2,content3,content4,content5,content6,content7,content8,content9,content10
dim kk,reshow,pwidth,pheight,up
dim userid,username,sessionid
bbsid=trim(request.querystring("bbsid"))
tid=trim(request.querystring("tid"))
up=trim(request.querystring("up"))
if bbsid="" or Isnumeric(bbsid)=False then
Call Error("ID无效!")
end if

if up<>0 then
if tid="" or Isnumeric(tid)=False then
Call Error("ID无效!")
end if
up=clng(up)
end if
kk=0

set upload=new upfile_class ''建立上传对象
upload.GetData(104857600) '取得上传数据,限制最大上传100M
if upload.err > 0 then '如果出错
select case upload.err
case 1
msg= "请先选择你要上传的文件!"
case 2
msg= "你上传的文件总大小超出了最大限制(100M)"
end select
'showWML()


response.end
end if

SavePath = "file/"



title=forbbs(upload.form("name"))
content=forbbs(upload.form("content"))
content=replace(content,"sid=sid","sid=@@sid@@")
content1=forbbs(upload.form("content1"))
content2=forbbs(upload.form("content2"))
content3=forbbs(upload.form("content3"))
content4=forbbs(upload.form("content4"))
content5=forbbs(upload.form("content5"))
content6=forbbs(upload.form("content6"))
content7=forbbs(upload.form("content7"))
content8=forbbs(upload.form("content8"))
content9=forbbs(upload.form("content9"))
content10=forbbs(upload.form("content10"))

if len(content1)>50 or len(content2)>50 or len(content3)>50 or len(content4)>50 or len(content5)>50 or len(content6)>50 or len(content7)>50 or len(content8)>50 or len(content9)>50 or len(content10)>50 then
Call Error("文件内容最多50字,请返回重试!")
end if

'if dotype="" then
if up=2 then
Sub Fortxtrel
if bbsid<>"" then
set rs=server.createobject("adodb.recordset")
rs.open "select bbsid,strrel,strall from hmd where bbsid="&bbsid&" and guliid="&myid,conn,1,1
if not rs.eof then
if rs("strrel")>0 then
Call Error("你在本版已被禁回复!")
end if
if rs("strall")>0 then
Call Error("你在本版已被加黑!")
end if
end if
rs.close
set rs=nothing
end if

set rs=server.createobject("adodb.recordset")
rs.open "select bbsid,strrel,strall from hmd where bbsid=0 and guliid="&myid,conn,1,1
if not rs.eof then
if rs("strrel")>0 then
Call Error("你已被禁回复!")
end if
if rs("strall")>0 then
Call Error("你已被加黑!")
end if
end if
rs.close
set rs=nothing
end Sub
CALL Fortxtrel
if content="" then
Call Error("回复内容不能为空,请返回重试!")
end if
if len(content)>300 then
Call Error("回复内容最多300字,请返回重试!")
end if
else
Sub Fortxtsell
if bbsid<>"" then
set rs=server.createobject("adodb.recordset")
rs.open "select bbsid,strsell,strall from hmd where bbsid="&bbsid&" and guliid="&myid,conn,1,1
if not rs.eof then
if rs("strsell")>0 then
Call Error("你在本版已被禁言!")
end if
if rs("strall")>0 then
Call Error("你在本版已被加黑!")
end if
end if
rs.close
set rs=nothing
end if

set rs=server.createobject("adodb.recordset")
rs.open "select bbsid,strsell,strall from hmd where bbsid=0 and guliid="&myid,conn,1,1
if not rs.eof then
if rs("strsell")>0 then
Call Error("你已被禁言!")
end if
if rs("strall")>0 then
Call Error("你已被加黑!")
end if
end if
rs.close
set rs=nothing
end Sub
CALL Fortxtsell

if title="" or content="" then
Call Error("标题、内容不能为空,请返回重试!")
end if
if len(title)<4 then
Call Error("标题不能少于4字!")
end if

if len(title) > 30 then
Call Error("标题不能多于30字!")
end if

if len(content)<8 then
Call Error("内容不能少于8字!")
end if

end if
if session("title")=title and session("content")=content then

Call Error("请不要发重复提交!")
end if

for each formName in upload.file
set ofile=upload.file(formName) '生成一个文件对象
upfilename=ofile.FileName
oFileSize=ofile.filesize
sizes=cstr(round(oFileSize/1024))
fileExt=lcase(ofile.FileExt)

if fileEXT="asp" or fileEXT="asa" or fileEXT="aspx" or fileEXT="exe" or fileEXT="bat" or fileEXT="dll" or fileEXT="php" or fileEXT="jsp" or fileEXT="spx" or fileEXT="cs" then
EnableUpload=false
end if
if EnableUpload=false then
msg="这种文件类型不允许上传:asp|asa|aspx|exe|bat|..."
FoundErr=true
'showWML()
response.end
end if
if oFileSize>(MaxFileSize*1024) then
msg="文件大小超过了限制,最大只能上传" & CStr(MaxFileSize) & "K的文件!"
FoundErr=true
'showWML()
msg=msg & "<br/><a href=""board.asp?bbsid="&bbsid&"&sid="&sid&""">返回论坛</a><br/>"
response.write msg
response.write "</p></card></wml>"

response.end
end if


if FoundErr<>true then
randomize
ranNum=int(900*rnd)+100

strMonth=month(now)
if len(strMonth)=1 then
strMonth="0"&strMonth
end if
strDay=day(now)
if len(strDay)=1 then
strDay="0"&strDay
end if

'--------------------
...全文
81 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
春天的气息 2010-04-23
  • 打赏
  • 举报
回复
什么意思呀,把 on error resume next屏蔽了,错误就会有提示的。
KK3K2005 2010-04-23
  • 打赏
  • 举报
回复
耐心点调试
多找找就有经验了
helloword222 2010-04-23
  • 打赏
  • 举报
回复
期待能挑战的高手
在 2012 年的时候,我(作者)加入到奇虎 360 公司,为新的产品做技术选型。由于之前一直混迹在 Python 圈子 里面,也接触过 Nginx c 模块的高性能开发,一直想找到一个兼备 Python 快速开发和 Nginx c 模块高性能的产 品。看到 OpenResty 后,有发现新大陆的感觉。 于是我在新产品里面力推 OpenResty ,团队里面几乎没有人支持,经过几轮性能测试,虽然轻松击败所有的其 他方案,但是其他开发人员并不愿意参与到基于 OpenResty 这个“陌生”框架的开发中来。于是我一个人开始 了 OpenResty 之旅,刚开始经历了各种技术挑战,庆幸有详细的文档,以及春哥和邮件列表里面热情的帮 助,我成了团队里面 bug 最少和几乎不用加班的同学。 2014 年,团队进来了一批新鲜血液,他们都很有技术品味,先后都选择 OpenResty 来作为技术方向。我不再 是一个人在战斗,而另外一个新问题摆在团队面前,如何保证大家都能写出高质量的代码,都能对 OpenResty 有深入的了解?知识的沉淀和升华,成为一个迫在眉睫的问题。 我们选择把这几年的一些浅薄甚至可能是错误的实践,通过 Gitbook 的方式公开出来,一方面有利于团队自身的 技术积累,另一方面,也能让更多的高手一起加入,让 OpenResty 的使用变得更加简单,更多的应用到服务端 开发中,毕竟人生苦短,少一些加班,多一些陪家人。 这本书的定位是最佳实践,并不会对 OpenResty 做基础的介绍。想了解基础的同学,请不要看书,而是马上安 装 OpenResty ,把官方网站的 Presentations 浏览和实践几遍。 希望你能 enjoy OpenResty 之旅!
温铭 王院生  and 13 贡献者 OpenResty最佳实践  开源书籍项目                             --by 温铭  “在2012年的时候,我加入到奇虎360公司,为新的产品做技术选型。由于之前一直混迹在python圈子里面,也接触过nginx c模块的高性能开发,一直想找到一个兼备python快速开发和nginx c模块高性能的产品。看到OpenResty后,有发现新大陆的感觉。 于是我在新产品里面力推OpenResty,团队里面几乎没有人支持,经过几轮性能测试,虽然轻松击败所有的其他方案,但是其他开发人员并不愿意参与到基于OpenResty这个“陌生”框架的开发中来。于是我一个人开始了OpenResty之旅,刚开始经历了各种技术挑战,庆幸有详细的文档,以及春哥和邮件列表里面热情的帮助,我成了团队里面bug最少和几乎不用加班的同学。 2014年,团队进来了一批新鲜血液,他们都很有技术品味,先后都选择OpenResty来作为技术方向。我不再是一个人在战斗,而另外一个新问题摆在团队面前,如何保证大家都能写出高质量的代码,都能对OpenResty有深入的了解?知识的沉淀和升华,成为一个迫在眉睫的问题。 我们选择把这几年的一些浅薄甚至可能是错误的实践,通过gitbook的方式公开出来,一方面有利于团队自身的技术积累,另一方面,也能让更多的高手一起加入,让OpenResty的使用变得更加简单,更多的应用到服务端开发中,毕竟人生苦短,少一些加班,多一些陪家人。 这本书的定位是最佳实践,同时会对OpenResty做简单的基础介绍。但是我们对初学者的建议是,在看书的同时下载并安装OpenResty,把官方网站的Presentations浏览和实践几遍。 希望你能enjoy OpenResty之旅!"

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧