Subscript out of range

vividfox 2004-01-15 08:36:08
LyfUpload 错误 '80020009'

Subscript out of range

/金和田/manager/doupload.asp,行 15


代码如下:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>文件上传</title>
</head>

<body>
<!--#include file="conn.asp"-->
<!--#include file="top.asp"-->
<%if session("user")=empty then
response.Write "<div align='center'>您没有登陆!请返回<a href='login.asp'>登陆页</a>登陆!</div>"
else

set uploadphoto = Server.CreateObject("LyfUpload.UploadFile")

for i=1 to cint(request.QueryString("counts"))
if obj.request("button"&i)=empty then
response.Write ("<div align='center'>文件"&i&"没有选择!请返回<input type=button value='上一页' onClick='history.back(-1)' >选择完整!</div>")
response.end
end if
next

uploadphoto.extname="gif,jpg,jpeg"

for i=1 to request.QueryString("counts")
filename=uploadphoto.savefile("button"&i,server.MapPath("/")+"/photo/",false)
filenames=filenames+";"+filename
if filename="1" then
response.Write("<div align='center'>文件"&i&"上传图片必须是jpg,jpeg,gif格式!</div>")
response.End
elseif filename="3" then
response.Write("<div align='center'>文件"&i&"图片名已存在,请重新命名!<div>")
response.End
end if
next

if request.QueryString("id")=empty then
objrs.open "select 图片 from "&request.QueryString("typename")&"",conn,1,3
objrs.addnew
else objrs.open "select 图片 from"&request.QueryString("typename")&" where 序号="&request.QueryString("id")&"",conn,1,3
end if

objrs("图片")=filenames
objrs.update

response.Write("<div align='center'>所有文件上传成功!请返回<a href='manager.asp?typename="&request.QueryString("typename")&"'>网站后台管理页面!</a></div>")

end if%>
<!--#include file="buttom.asp"-->

</body>
</html>

第15行是 set uploadphoto = Server.CreateObject("LyfUpload.UploadFile")

请各位帮忙解决,小弟很急!!!
...全文
287 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
vividfox 2004-01-16
  • 打赏
  • 举报
回复
那个组件我已经注册了阿!!
luluso 2004-01-15
  • 打赏
  • 举报
回复
在开始菜单的运行里输入:
regsvr32 d:lyfupload.dll
luluso 2004-01-15
  • 打赏
  • 举报
回复
使用前先注册下lyfupload的组件
开始-运行-那里注册下lyf的那个dll文件.
aoeiuvcom 2004-01-15
  • 打赏
  • 举报
回复
看看LyfUpload这个组件的帮助

应该是使用上的错误或者笔误
关于龙书第13章地形绘制的terrain项目运行出错问题 (注:龙书即:《DirectX9.0 3D游戏开发编程基础》) 在学习该教材时,当我们试着编译并运行13章地形绘制的terrain项目时,发现运行出错,并弹出了一个出错提示窗口,提示我们::访问vector 越界了 提示窗口的内容如下: -------------------------------------------------------------------- Microsoft Visual C++ Debug Library Debug Assertion failed! Program:...cuments and Settings\Administrator\Terrain\Debug\Terrain.exe File: d:\microsoft visual studio 10.0\vc\include\vector Line:932 Expression : vector subscript out of range For information on how your program can cause an assertion Failure , see the Visual C++ documentation on asserts. (Press Retry to debug the application) [终止(A)] [重试(R)] [忽略(I)] ---------------------------------------------------------------------------------- 问题主要出现在terrain.cpp 文件中的几个函数内部传递参数最终作为了vector的索引值,得到的索引值没有经过限定,导致超出了vector的界限-----最终访问越界. 修改的地方在下面这几处: 在terrain.cpp文档里搜索”//修改过!!!” bool Terrain::genTexture(D3DXVECTOR3* directionToLight) float Terrain::computeShade(int cellRow, int cellCol, D3DXVECTOR3* directionToLight) float Terrain::getHeight(float x, float z) 在terrain.cpp文档里搜索”//注意这里!!!” /int Terrain::getHeightmapEntry(int row, int col) bool Terrain::lightTerrain(D3DXVECTOR3* directionToLight) 在terrainDriver.cpp文档里搜索”//注意这里!!!” float height = TheTerrain->getHeight( pos.x, pos.z ); 我的修改主要是通过在传递索引值的地方,限定索引值的范围,这样就避免了vector访问越界,这也是龙书作者在写该13章的代码时一时所忽略掉的. 只修改过terrain.cpp文件中的内容,其他的都没动.所以可以只将terrain.cpp拷贝到工程中替换掉原来的就可以了.

28,406

社区成员

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

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