| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 572 人关注过本帖
标题:图片上传代码显示 类没有被定义: 'boaisc'
只看楼主 加入收藏
sdjay
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-10-4
结帖率:0
收藏
已结贴  问题点数:20 回复次数:6 
图片上传代码显示 类没有被定义: 'boaisc'
Microsoft VBScript 运行时错误 '800a01fa'

类没有被定义: 'boaisc'

\up\c_boaisc.asp, line 3
搜索更多相关主题的帖子: Microsoft 图片上传 
2011-10-04 17:33
sdjay
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-10-4
收藏
得分:0 
上传页面代码b_boaisc.asp

<style type="text/css">
<!--
body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #000000;
}
-->
</style>
<body >
<%
    fanhui=request("fanhui")
    wjm=request("wjm")
    if fanhui="cg" then
    response.Write("上传成功:<a href="& wjm &" target=_blank>查看图片</a>&nbsp;&nbsp;<a href=""b_boaisc.asp"">重新上传</a>")
    else
%>
<form action="c_boaisc.asp" method="post" enctype="multipart/form-data">
  <input name="image" type="file" class="text" id="image">
  <input name="submit" type="submit" class="form" id="submit" value="上传">
<%
        if fanhui="" then
            response.Write("")
        elseif fanhui="yk" then
            response.Write("")
        elseif fanhui="da" then
            response.Write("")
        elseif fanhui="lx" then
            response.Write("")
        end if
    end if
%>
</form>
2011-10-04 17:35
sdjay
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-10-4
收藏
得分:0 
c_boaisc.asp文件

<!--#include file="d_boaisc.asp" -->
<%
set sc=new boaisc
for each shuju in sc.file
set wj=sc.file(shuju)
kzm=lcase(right(wj.filename,4))
if file_size>1024000 then
response.Redirect("b_boaisc.asp?fanhui=da")
end if
if kzm<>".jpg" and kzm<>".gif" then
response.Redirect("b_boaisc.asp?fanhui=lx")
end if
wjm="../pic/"&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&int(rnd)&kzm
wjm2="pic/"&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&int(rnd)&kzm
wj.saveas server.MapPath(wjm)
next
%>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language=JavaScript>
function image_success()
{
parent.formzc.pic_url.value="<%=wjm2%>";
window.location="b_boaisc.asp?fanhui=cg&wjm=<%=wjm%>";
}
</script></head><body leftmargin="0" topmargin="0" onLoad="image_success()">
</body>
</html>
2011-10-04 17:35
sdjay
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-10-4
收藏
得分:0 
c_boaisc1文件

<!--#include file="d_boaisc.asp" -->
<%
set sc=new boaisc
for each shuju in sc.file
set wj=sc.file(shuju)
kzm=lcase(right(wj.filename,4))
if file_size>1024000 then
response.Redirect("b_boaisc.asp?fanhui=da")
end if
if kzm<>".jpg" and kzm<>".gif" then
response.Redirect("b_boaisc.asp?fanhui=lx")
end if
wjm="../pic/"&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&int(rnd)&kzm
wjm2="pic/"&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&int(rnd)&kzm
wj.saveas server.MapPath(wjm)
next
%>
<%
Dim Jpeg,Jpeg1
'建立实例
Set Jpeg = Server.CreateObject("Persits.Jpeg")
Set Jpeg1 = Server.CreateObject("Persits.Jpeg")
'打开要加水印的图片
Jpeg.Open Server.mappath(wjm)
'透明图片水印图
Jpeg1.Open Server.mappath("sy.bmp")
'合并图
Jpeg.Canvas.DrawImage 2,2,Jpeg1,0.6,&HFFFFFF
' 保存文件
Jpeg.Save Server.mappath(wjm)
' 注销对象
Set Jpeg = Nothing
Set Jpeg1 = Nothing
%>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language=JavaScript>
function image_success()
{
parent.formzc.pic_url.value="<%=wjm2%>";
window.location="b_boaisc.asp?fanhui=cg&wjm=<%=wjm%>";
}
</script></head><body leftmargin="0" topmargin="0" onLoad="image_success()">
</body>
</html>
2011-10-04 17:35
sdjay
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-10-4
收藏
得分:0 
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
dim upfile_5xSoft_Stream
Class boaisc
dim Form,File,Version
Private Sub Class_Initialize
dim iStart,iFileNameStart,iFileNameEnd,iEnd,vbEnter,iFormStart,iFormEnd,theFile
dim strDiv,mFormName,mFormValue,mFileName,mFileSize,mFilePath,iDivLen,mStr
Version="个人"
if Request.TotalBytes<1 then Exit Sub
set Form=CreateObject("Scripting.Dictionary")
set File=CreateObject("Scripting.Dictionary")
set upfile_5xSoft_Stream=CreateObject("Adodb.Stream")
upfile_5xSoft_Stream.mode=3
upfile_5xSoft_Stream.type=1
upfile_5xSoft_Stream.open
upfile_5xSoft_Stream.write Request.BinaryRead(Request.TotalBytes)

vbEnter=Chr(13)&Chr(10)
iDivLen=inString(1,vbEnter)+1
strDiv=subString(1,iDivLen)
iFormStart=iDivLen
iFormEnd=inString(iformStart,strDiv)-1
while iFormStart < iFormEnd
  iStart=inString(iFormStart,"name=""")
  iEnd=inString(iStart+6,"""")
  mFormName=subString(iStart+6,iEnd-iStart-6)
  iFileNameStart=inString(iEnd+1,"filename=""")
  if iFileNameStart>0 and iFileNameStart<iFormEnd then
   iFileNameEnd=inString(iFileNameStart+10,"""")
   mFileName=subString(iFileNameStart+10,iFileNameEnd-iFileNameStart-10)
   iStart=inString(iFileNameEnd+1,vbEnter&vbEnter)
   iEnd=inString(iStart+4,vbEnter&strDiv)
   if iEnd>iStart then
    mFileSize=iEnd-iStart-4
   else
    mFileSize=0
   end if
   set theFile=new FileInfo
   theFile.FileName=getFileName(mFileName)
   theFile.FilePath=getFilePath(mFileName)
   theFile.FileSize=mFileSize
   theFile.FileStart=iStart+4
   theFile.FormName=FormName
   file.add mFormName,theFile
  else
   iStart=inString(iEnd+1,vbEnter&vbEnter)
   iEnd=inString(iStart+4,vbEnter&strDiv)

   if iEnd>iStart then
    mFormValue=subString(iStart+4,iEnd-iStart-4)
   else
    mFormValue=""
   end if
   form.Add mFormName,mFormValue
  end if

  iFormStart=iformEnd+iDivLen
  iFormEnd=inString(iformStart,strDiv)-1
wend
End Sub

Private Function subString(theStart,theLen)
 dim i,c,stemp
 upfile_5xSoft_Stream.Position=theStart-1
 stemp=""
 for i=1 to theLen
   if upfile_5xSoft_Stream.EOS then Exit for
   c=ascB(upfile_5xSoft_Stream.Read(1))
   If c > 127 Then
    if upfile_5xSoft_Stream.EOS then Exit for
    stemp=stemp&Chr(AscW(ChrB(AscB(upfile_5xSoft_Stream.Read(1)))&ChrB(c)))
    i=i+1
   else
    stemp=stemp&Chr(c)
   End If
 Next
 subString=stemp
End function

Private Function inString(theStart,varStr)
 dim i,j,bt,theLen,str
 InString=0
 Str=toByte(varStr)
 theLen=LenB(Str)
 for i=theStart to upfile_5xSoft_Stream.Size-theLen
   if i>upfile_5xSoft_Stream.size then exit Function
   upfile_5xSoft_Stream.Position=i-1
   if AscB(upfile_5xSoft_Stream.Read(1))=AscB(midB(Str,1)) then
    InString=i
    for j=2 to theLen
      if upfile_5xSoft_Stream.EOS then
        inString=0
        Exit for
      end if
      if AscB(upfile_5xSoft_Stream.Read(1))<>AscB(MidB(Str,j,1)) then
        InString=0
        Exit For
      end if
    next
    if InString<>0 then Exit Function
   end if
 next
End Function

Private Sub Class_Terminate  
  form.RemoveAll
  file.RemoveAll
  set form=nothing
  set file=nothing
  upfile_5xSoft_Stream.close
  set upfile_5xSoft_Stream=nothing
End Sub
   
 
 Private function GetFilePath(FullPath)
  If FullPath <> "" Then
   GetFilePath = left(FullPath,InStrRev(FullPath, "\"))
  Else
   GetFilePath = ""
  End If
 End  function
 
 Private function GetFileName(FullPath)
  If FullPath <> "" Then
   GetFileName = mid(FullPath,InStrRev(FullPath, "\")+1)
  Else
   GetFileName = ""
  End If
 End  function

 Private function toByte(Str)
   dim i,iCode,c,iLow,iHigh
   toByte=""
   For i=1 To Len(Str)
   c=mid(Str,i,1)
   iCode =Asc(c)
   If iCode<0 Then iCode = iCode + 65535
   If iCode>255 Then
     iLow = Left(Hex(Asc(c)),2)
     iHigh =Right(Hex(Asc(c)),2)
     toByte = toByte & chrB("&H"&iLow) & chrB("&H"&iHigh)
   Else
     toByte = toByte & chrB(AscB(c))
   End If
   Next
 End function
End Class


Class FileInfo
  dim FormName,FileName,FilePath,FileSize,FileStart
  Private Sub Class_Initialize
    FileName = ""
    FilePath = ""
    FileSize = 0
    FileStart= 0
    FormName = ""
  End Sub
  
 Public function SaveAs(FullPath)
    dim dr,ErrorChar,i
    SaveAs=1
    if trim(fullpath)="" or FileSize=0 or FileStart=0 or FileName="" then exit function
    if FileStart=0 or right(fullpath,1)="/" then exit function
    set dr=CreateObject("Adodb.Stream")
    dr.Mode=3
    dr.Type=1
    dr.Open
    upfile_5xSoft_Stream.position=FileStart-1
    upfile_5xSoft_Stream.copyto dr,FileSize
    dr.SaveToFile FullPath,2
    dr.Close
    set dr=nothing
    SaveAs=0
  end function
End Class
</SCRIPT>
2011-10-04 17:36
sdjay
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-10-4
收藏
得分:0 
希望大家能帮我好好的看看
2011-10-04 17:36
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:20 
5楼的代码<!--#include file="d_boaisc.asp" -->在这个文件里?
2011-10-04 18:27
快速回复:图片上传代码显示 类没有被定义: 'boaisc'
数据加载中...
 
   



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

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