| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 782 人关注过本帖
标题:[求助]版主求助
只看楼主 加入收藏
andy82511
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2006-5-15
收藏
 问题点数:0 回复次数:6 
[求助]版主求助

这是整个文件。在点击转到下一页时出现以下错误,请版主帮忙解决!

Microsoft VBScript 运行时错误 错误 '800a000d'

类型不匹配: '[string: ""]'

/admin/upFileManage.asp,行44

<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.asp';</script>"
response.End
else
if session("flag")=2 then
response.Write "<p align=center><font color=red>您没有此项目管理权限!</font></p>"
response.End
end if
end if
%>
<!--#include file =conn.asp-->
<head>
<link rel="stylesheet" type="text/css" href="../images/css.css">
</head>

<SCRIPT language = "JavaScript">
<!--//
function unselectall()
{
if(document.myform.chkAll.checked){
document.myform.chkAll.checked = document.myform.chkAll.checked&0;
}
}

function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll")
e.checked = form.chkAll.checked;
}
}

//-->
</script>
<%
dim MaxPerPage
dim strFileName,path,FileName
dim totalPut,CurrentPage,TotalPages,FilePath
dim UploadDir,TruePath,fso,theFolder,theFile,whichfile,thisfile,FileCount,TotleSize
strFileName="upFileManage.asp"
viewtype=Request("viewtype")
if viewtype=1 then
MaxPerPage=15
else
MaxPerPage=35
end if
if request("path")<>"" then
path=request("path")
else
path="../bookpic/"
end if
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if

if right(path,1)<>"/" then
UploadDir="" & path & "/"
else
UploadDir="" & path
end if
TruePath=Server.MapPath(UploadDir)

If not IsObjInstalled("Scripting.FileSystemObject") Then
Response.Write "<b><font color=red>你的服务器不支持 FSO(Scripting.FileSystemObject)! 不能使用本功能</font></b>"
Else
set fso=CreateObject("Scripting.FileSystemObject")
if request("Action")="Del" then
call DelFiles()
end if
function gotTopic(str,strlen)
if str="" then
gotTopic=""
exit function
end if
dim l,t,c, i
str=replace(replace(replace(replace(str,"&nbsp;"," "),"&quot;",chr(34)),"&gt;",">"),"&lt;","<")
l=len(str)
t=0
for i=1 to l
c=Abs(Asc(Mid(str,i,1)))
if c>255 then
t=t+2
else
t=t+1
end if
if t>=strlen then
gotTopic=left(str,i) & "…"
exit for
else
gotTopic=str
end if
next
gotTopic=replace(replace(replace(replace(gotTopic," ","&nbsp;"),chr(34),"&quot;"),">","&gt;"),"<","&lt;")
end function

function JoinChar(strUrl)
if strUrl="" then
JoinChar=""
exit function
end if
if InStr(strUrl,"?")<len(strUrl) then
if InStr(strUrl,"?")>1 then
if InStr(strUrl,"&")<len(strUrl) then
JoinChar=strUrl & "&"
else
JoinChar=strUrl
end if
else
JoinChar=strUrl & "?"
end if
else
JoinChar=strUrl
end if
end function
Function IsObjInstalled(strClassString)
On Error Resume Next
IsObjInstalled = False
Err = 0
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then IsObjInstalled = True
Set xTestObj = Nothing
Err = 0
End Function
Function GetPath '###获取路径
dim s
s=Request.ServerVariables("path_translated")
GetPath=left(s,instrrev(s,"\",len(s)))
End function
%>
<script language="JavaScript">
function ConfirmDel()
{
if (confirm("你真的要删除此文件吗!"))
return true;
else
return false;
}
</script>
<div align="center">
<table width="96%" border="0" cellspacing="1" class="tableBorder" style="background-color: #E8F1FF">
<tr><th height="22" background="images/bg_3.gif">上传文件管理</th></tr>
<tr>
<td class="forumRowHighlight" height=23> &nbsp;&nbsp;<b>注意</b>:<BR>本功能必须服务器支持FSO权限方能使用,FSO使用帮助请浏览微软网站。如果您服务器不支持FSO请手动管理。<BR></td>
</tr>
<form method="POST" action="?action=pathname">
<tr>
<td class="forumRowHighlight" height=23> <input type="text" name="path" value=<%=path%> size="40" class="td2">&nbsp;<input type="checkbox" name="viewtype" value="1" <% if viewtype=1 then %> checked <% end if %>>缩略图&nbsp;
<input type="submit" value="确认提交" class="button">

(<font color=red>请填写正确的文件夹名或路径</font>)</td>
</tr>
</form>
<tr><td height="22" align="center" class="forumRow"><b>当前浏览 <%=path%> 目录的所有文件列表如下</b></td></form></td></tr>
</table>
</div>
<%
if fso.FolderExists(TruePath)then
FileCount=0
TotleSize=0
Set theFolder=fso.GetFolder(TruePath)
For Each theFile In theFolder.Files
FileCount=FileCount+1
TotleSize=TotleSize+theFile.Size
next
totalPut=FileCount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if

end if
if currentPage=1 then
showpage2 strFileName,totalput,MaxPerPage
showContent
showpage2 strFileName,totalput,MaxPerPage

else
if (currentPage-1)*MaxPerPage<totalPut then
showpage2 strFileName,totalput,MaxPerPage
showContent
showpage2 strFileName,totalput,MaxPerPage

else
currentPage=1
showpage2 strFileName,totalput,MaxPerPage
showContent
showpage2 strFileName,totalput,MaxPerPage

end if
end if
else
response.write "找不到文件夹!可能是配置有误!"
end if
end if

sub showContent()
dim c
FileCount=0
TotleSize=0
%>
<div align="center">
<table width="966" border="0" cellspacing="1" class="tableBorder" style="background-color: #E8F1FF">
<form name="myform" method="post" action="" onsubmit="return confirm('确定要删除选中的文件吗?');">
<tr><th height="20" width="35"> </th>
<th height="20" width="196">文件名</th>
<th height="20">文件大小</th>
<th height="20">文件类型</th>
<th height="20">最后修改时间</th>
</tr>
<%

For Each theFile In theFolder.Files
if Not Response.IsClientConnected then responseend
c=c+1
if FileCount>=MaxPerPage then
exit for
elseif c>MaxPerPage*(CurrentPage-1) then
%>
<tr>
<td width="35" class="forumRowHighlight"><input type="checkbox" name="FileName" value="<%=theFile.Name%>" title="<%=theFile.Name%>"></td>
<td width="196" class="forumRowHighlight" align="center"><a href="<%=(UploadDir & theFile.Name)%>" target="_blank">
<% if viewtype<>1 then %>
<%=theFile.Name%>
<% else %>
<img src="<%=UploadDir & theFile.Name%>" width="100" border="0"><br>fdf<%=theFile.Name%>
<% end if %>
</a></td>
<td width="151" align="right" class="forumRow"><%=theFile.size%>字节</td>
<td width="235" align="center" class="forumRow"><%=theFile.type%></td>
<td width="235" align="center" class="forumRow"><%=theFile.DateLastModified%></td>
</tr>
<%
FileCount=FileCount+1
TotleSize=TotleSize+theFile.Size
end if
Next
%>
<tr><td class="forumRow" align="center" colspan="5"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">全选/反选 
<input name="Action" type="hidden" id="Action" value="Del">
<input type="submit" name="Submit" value="删除选中的文件" class="button"></td></tr>
</form>
</table>
</div>

<%
end sub
%>
</body>
</html>
<%
sub showpage2(sfilename,totalnumber,maxperpage)
dim n, i,strTemp
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
strTemp= "<table align='center'><form method='Post' action='" & sfilename & "?path="&request("path")& "&viewtype=" & viewtype &"'><tr><td>"
strTemp=strTemp & "共 <b>" & totalnumber & "</b> 个文件,占用 <b>" & TotleSize\1024 & "</b> K&nbsp;&nbsp;&nbsp;"
sfilename=JoinChar(sfilename)
if CurrentPage<2 then
strTemp=strTemp & "首页 上一页&nbsp;"
else
strTemp=strTemp & "<a href='" & sfilename & "page=1&path="&request("path")& "&viewtype=" & viewtype & "'>首页</a>&nbsp;"
strTemp=strTemp & "<a href='" & sfilename & "page=" & (CurrentPage-1) & "&viewtype=" & viewtype & "&path="&request("path")&"'>上一页</a>&nbsp;"
end if

if n-currentpage<1 then
strTemp=strTemp & "下一页 尾页"
else
strTemp=strTemp & "<a href='" & sfilename & "page=" & (CurrentPage+1) & "&viewtype=" & viewtype & "&path="&request("path")&"'>下一页</a>&nbsp;"
strTemp=strTemp & "<a href='" & sfilename & "page=" & n & "&path="&request("path")& "&viewtype=" & viewtype &"'>尾页</a>"
end if
strTemp=strTemp & "&nbsp;页次:<strong><font color=red>" & CurrentPage & "</font>/" & n & "</strong>页 "
strTemp=strTemp & "&nbsp;<b>" & maxperpage & "</b>" & "个文件/页"
strTemp=strTemp & "&nbsp;转到:<select name='page' size='1' onchange='javascript:submit()'>"
for i = 1 to n
strTemp=strTemp & "<option value='" & i & "'"
if cint(CurrentPage)=cint(i) then strTemp=strTemp & " selected "
strTemp=strTemp & ">第" & i & "页</option>"
next
strTemp=strTemp & "</select>"
strTemp=strTemp & "</td></tr></form></table>"
response.write strTemp
end sub
sub DelFiles()
dim whichfile,arrFileName,i
whichfile=trim(Request("FileName"))
if whichfile="" then exit sub
if instr(whichfile,",")>0 then
arrFileName=split(whichfile,",")
for i=0 to ubound(arrFileName)
if left(trim(arrFileName(i)),3)<>"../" and left(trim(arrFileName(i)),1)<>"/" then
whichfile=server.MapPath(UploadDir & trim(arrFileName(i)))
set thisfile=fso.GetFile(whichfile)
thisfile.Delete True
end if
next
else
if left(whichfile,3)<>"../" and left(whichfile,1)<>"/" then
Set thisfile = fso.GetFile(server.MapPath(UploadDir & whichfile))
thisfile.Delete True
end if
Response.Redirect(""&Request.ServerVariables("HTTP_REFERER")&"")
end if
end sub
%>

搜索更多相关主题的帖子: face 宋体 Microsoft 
2006-06-14 16:40
icecool
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:20
帖 子:1216
专家分:1376
注 册:2005-3-14
收藏
得分:0 
直接点上一页,下一页的时候有问题吗?

http://toorup.3v.do
loading...
2006-06-14 17:04
andy82511
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2006-5-15
收藏
得分:0 
直接点下一页和跳转到某某页都有一样的问题!
2006-06-14 21:47
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 

href='" & sfilename & "page="

这里的这个page有CInt(Request("page"))或者CLng(Request("page"))或者CDbl(Request("page"))这样类似的操作吗?

2006-06-14 22:04
andy82511
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2006-5-15
收藏
得分:0 

版主我把网页链接贴出来
http://www.cnbys.net/it/admin/login.asp 帐号密码均为admin

出错的是这个页面 http://www.cnbys.net/it/admin/upfilemanage.asp 点转到下一页或跳转就出错

2006-06-16 09:17
andy82511
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2006-5-15
收藏
得分:0 
打不开请多刷新几次
2006-06-16 09:18
icecool
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:20
帖 子:1216
专家分:1376
注 册:2005-3-14
收藏
得分:0 

页面没别的问题,链接地址有问题

http://www.cnbys.net/it/admin/upFileManage.asp?page=1

http://www.cnbys.net/it/admin/upFileManage.asp?page=2

http://www.cnbys.net/it/admin/upFileManage.asp?page=3

这样都可正确显示,你把上一页,下一页链接都设成直接指向upFileManage.asp,不要用变量试试看!别PATH,type等参数不要!


http://toorup.3v.do
loading...
2006-06-16 13:11
快速回复:[求助]版主求助
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023250 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved