当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: sql server2000的数据类型中有没有自动增长的类型,就象access中的自动增长类型一样功能的?/ ......
 ·一个有关java图形编程的问题    »显示摘要«
    摘要: 请问各位我如何保存用drasline()画出的图形。 谢谢! ......


出200分 帮忙看个文件的错误 并 给予改正 谢谢

上传图片文件代码如下:  
   
  <!--#include   file=conn.asp-->  
  <%  
  set   rs=server.createobject("adodb.recordset")  
  rs.open   "select   *   from   picture",conn,1,3  
   
  set   obj=server.createobject("lyfupload.uploadfile")  
   
  obj.maxsize=1048576 限制上传文件最大值为  
  obj.extname="gif,jpg" 限制上传文件的扩展名  
   
  filestat=obj.savefiletodb("file")  
  filetype=obj.filetype("file")  
   
  if   filestat=""   then   response.redirect   "admin_imgupload.asp?alert=文件上传失败!"  
  if   filestat="0"   then   response.redirect   "admin_imgupload.asp?alert=文件大小应小于"&round(obj.maxsize/1048576,0)&"M!"  
  if   filestat="1"   then   response.redirect   "admin_imgupload.asp?alert=不正确的文件类型,您只可以上传"&obj.extname&"文件!"  
   
  rs.addnew  
  rs("type")=filetype  
  rs("pic").appendchunk   obj.dbcontent  
  rs.update  
  %>  
  <script   language="javascript">  
  parent.document.thisform.body.value+="[upimgid=<%=rs("id")%>]"  
  location.href="admin_imgupload.asp?alert=<%=filestat%>(<%=round(obj.filesize/1048576,2)%>M)上传成功。"  
  </script>  
  <%  
  rs.close  
  set   rs=nothing  
  set   obj=nothing  
  conn.close  
  set   conn=nothing  
  %>  
   
  if   filestat=""   then   response.redirect   "admin_imgupload.asp?alert=文件上传失败!"   当这条语句存在的时候怎么也传不上   但不存在的时候可以上传成功但有显示不出图片  
   
  数据库picture表   相关字段及属性如下:  
  id       自动编号  
  pic     OLE对象  
  type   文本  
   
  是哪里的错误??请赐教!!   如果修改正确立即给分200   (UP无分   见谅!!)  
 

NO.1   作者: chinesun

1,文件大小限定太大了点,你若是限定为1M,那么你的Server.ScriptTimeOut=999999  
  要这样设。  
  时间要设长些。  
  2,  
  filestat=obj.savefiletodb("file")  
  filetype=obj.filetype("file")  
  这两个是怎么获取的?是否表单的域名不一样?你查一下你的表单与lyfupload组件的说明  
   
 

NO.2   作者: aloxy

一个论坛的文件上传  
  upload1.asp  
  <!--#INCLUDE   FILE="Connections.asp"   -->  
  <!--#include   file="conn.asp"   -->  
  <!--#include   file="bbs.css"   -->  
  <%取出变量  
  dim   h_uploadtext,lockupload,   uploadsize    
    sql="select   h_uploadtext,lockupload,   uploadsize   from   home"  
    set   rsconn1=conn.execute(sql)  
    if   not   rsconn1.eof   then  
  uploadsize   =rsconn1("uploadsize")  
  lockupload   =rsconn1("lockupload")  
  h_uploadtext=rsconn1("h_uploadtext")上传文件类型  
  end   if  
  set   rsconn1=nothing%>  
    <body   bgcolor=<%=tcolor2%>     topmargin="0"   leftmargin="0"   ><%   if   lockupload="1"   then%><div   class=tdc>上传功能已经被管理员关闭</div><%else%>    
  <form   method="post"   action="upload.asp?l_id=<%=request.querystring("l_id")%>"   enctype="multipart/form-data"   name="form2"   class=tdc   >  
  <input   type=file   name="file1"   size="40"     class=bdtj>  
  <input   type="submit"   name="submit"   value="上   传"   class=bdtj>  
  <input   type="hidden"   name="uploadtypefy"   value="upload/">  
    只能上传如下类型:<select     name="D1"     class=bdtj3>  
    <%   h_uploadtext1   =   split(h_uploadtext,   "|")  
          for   i   =   0   to   ubound(h_uploadtext1)  
            response.write("<option     class=bdtj2>"&h_uploadtext1(i)&"</optiong>")        
          next%>  
    </select>   限制为:<%=uploadsize\1000%>K  
  </form>  
  <%end   if%>  
  upload.asp  
  <!--#include   file="Connections.asp"   -->  
    <!--#include   file="conn.asp"   -->  
    <!--#include   file="bbs.css"   -->  
  <!--#include   FILE="upload.inc"-->  
  <%取出变量  
  dim   h_uploadtext,lockupload,   uploadsize,send_upload    
    sql="select   h_uploadtext,lockupload,   uploadsize,send_upload   from   home"  
    set   rsconn1=conn.execute(sql)  
    if   not   rsconn1.eof   then  
  uploadsize   =rsconn1("uploadsize")  
  lockupload   =rsconn1("lockupload")  
  h_uploadtext=rsconn1("h_uploadtext")上传文件类型  
  send_upload=rsconn1("send_upload")  
  end   if  
  set   rsconn1=nothing%>  
   
  <body   bgcolor=<%=tcolor2%>       class=tdc   topmargin="5">    
  <%   if   lockupload="1"   then  
    response.write   "错误:上传功能已经被管理员关闭"  
  response.end  
  end   if  
  if   Request.Cookies(l_url&"feiyue")("Username")=""   then  
    response.write   "错误:登陆论坛后才可以上传"  
  response.end  
  end   if  
   
  set   upload=new   upload_5xSoft   建立上传对象  
  formPath=upload.form("uploadtypefy")  
  if   session("upcount")=""   then   session("upcount")=0  
    set   file=upload.file("file1")     生成文件对象  
    if   file.FileSize=0   then      
      response.write   "错误:请选择要上传的文件!   <a   href=javascript:history.go(-1)>返回</a>"  
  response.end  
   
  elseif   session("upcount")>=send_upload   then  
    response.write   "错误:每次只能上传"&send_upload&"个文件   <a   href=javascript:history.go(-1)>返回</a>"  
  response.end  
  else  
    if   file.filesize>uploadsize   then  
    response.write   "错误:上传的文件大小超过了限制!   <a   href=javascript:history.go(-1)>返回</a>"  
  response.end  
  end   if  
    filename   =   split(file.FileName,".")    
    filehz   =   filename(ubound(filename))    
    h_uploadtext1   =   split(h_uploadtext,   "|")  
          for   i   =   0   to   ubound(h_uploadtext1)    
        if   filehz<>h_uploadtext1(i)   then  
  errornum=1    
  else  
            errornum=0  
  exit   for        
  end   if  
  next    
  if   filehz="asp"   and   filehz="asa"   and   filehz="aspx"   then判断上传的是否为非法文件  
  errornum=1  
  end   if  
  if   upload.form("uploadtypefy")="uploadface/"   then判断是否是上传头像,如果是,在判断上传的是否为图片  
  if   filehz<>"jpg"   and   filehz<>"jpeg"   and   filehz<>"gif"   and   filehz<>"bmp"     then  
  errornum=1  
  end   if    
  end   if  
   
  if   errornum=1   then  
        response.write   "错误:上传的文件格式不对!   <a   href=javascript:history.go(-1)>返回</a>"  
              response.end      
                end   if      
                     
    feiyue="fyzw_"&year(nowtime)&month(nowtime)&day(nowtime)&hour(nowtime)&minute(nowtime)&second(nowtime)&"."&filename(ubound(filename))  
      file.SaveAs   Server.mappath(formPath&feiyue)       保存文件  
      cpbfy=formPath&feiyue  
   
       
  if   upload.form("uploadtypefy")="uploadface/"   then判断是否是上传头像%>  
        <script>  
  parent.form1.imghead.value=<%=cpbfy%>  
  </script>  
       
   
        <%   response.write   file.FileName&"   ("&file.FileSize&")   头像上传成功!请记住你上传的头像下面的路径<br>"  
        else  
         
        if   filehz="jpg"   or   filehz="jpeg"   or   filehz="gif"   or   filehz="bmp"then判断上传的是否为图片%>  
   
      <script>  
  parent.form1.f3_content.value+=[uploadimg]<%=feiyue%>[/uploadimg]  
  </script>  
  <%else%>  
  <script>  
  parent.form1.f3_content.value+=[uploadfile]<%=feiyue%>[/uploadfile]  
  </script>  
  <%end   if  
  %>  
    <%    
    session("upcount")=session("upcount")+1  
    response.write   file.FileName&"   ("&file.FileSize&")   上传成功!<a   href=javascript:history.go(-1)>返回继续上传</a><br>"  
    end   if  
    end   if  
    set   file=nothing  
  set   upload=nothing      
   
  %>  
   
   
   
 


    摘要: #include<iostream> using namespace std; //int vandc(int); int main() { int age1=10,age2=33; int *page1=&age1,*page2=&age2; cout<<"before swap \nage1="<<age1<......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE