slon 离心选矿机:初学者asp网页问题。请求帮忙。

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 02:45:44
初学者asp网页问题。请求帮忙。
错误是:Microsoft VBScript 运行时错误 '800a01fa'

类没有被定义: 'upload_F'

\wwwroot\sub_upload.asp, line 18

下面是这个文件sub_upload.asp
<!--
-->
<%
if session("admin")="" then
response.redirect "index.asp"
end if
%>
<%
dim upload,file,formName,formPath,iCount,fileformat
set upload=new upload_F
function MakedownName()
dim fname
fname = now()
fname = replace(fname,"-","")
fname = replace(fname," ","")
fname = replace(fname,":","")
fname = replace(fname,"PM","")
fname = replace(fname,"AM","")
fname = replace(fname,"上午","")
fname = replace(fname,"下午","")
fname = int(fname) + int((10-1+1)*Rnd + 1)
MakedownName=fname
end function
formPath="upload/"
iCount=0
for each formName in upload.file ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象

fileformat=lcase(right(file.filename,4))

if fileformat=".asp" or fileformat=".exe" or fileformat=".txt" or fileformat=".htm" then
response.write"<script>alert('文件格式不对,请重新上传!');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
response.end
end if

if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
newname=MakedownName()&"."&mid(file.FileName,InStrRev(file.FileName, ".")+1)

file.SaveAs Server.mappath(formPath&newname) ''保存文件
iCount=iCount+1
else
response.write "<script>alert('没有找到文件,请重新上传!');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
response.end
end if
next
%>
<html>
<head>
<title>上传页</title>
<link rel="stylesheet" type="text/css" href="images/css.css">
<style>
body,td,input {font-size:12px;font-family:verdana,"宋体"}
.btn { font-size: 9pt; color: #000000; background: buttonface; border: 1px solid; border-color: #F8F7F5 #A39A89 #A39A89 #F8F7F5; padding-top: 2px; }
.box { border: 1px solid; border-color: #7C7461 #E3E1DB #E3E1DB #7C7461; background: #FFFFFF}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="images/bg.gif">
<%
response.write "<input type='text' name='address' size='30' value='upload/"&newname&"' class='Reg_Input'>("&cint(file.FileSize/1024)&"K)上传成功!"
%>
请自己复制到歌曲地址中!<a href="upload.asp">继续上传</a>
<%
set file=nothing
set upload=nothing ''删除此对象
%>
</body>
</html>
谁教我改改。。。。。。或加我QQ教一下我,550311557

你缺少一个上传组件,upload.inc.把这个文件在开始处包含进去就可以了.文件下载地址

<%
dim upload,file,formName,formPath,iCount,fileformat
set upload=new ---upload_F ----
function MakedownName() |
|
upload_F
加 在dim里定义一下

dim upload,file,formName,formPath,iCount,fileformat 改成 dim upload,file,formName,formPath,iCount,fileformat,upload_F 看看!