| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 821 人关注过本帖
标题:asp假死现象!
只看楼主 加入收藏
gaoxiaoweb
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2013-12-3
结帖率:100%
收藏
 问题点数:0 回复次数:9 
asp假死现象!
asp提交表单,根据表单控件的选项来执行相应的代码生成静态网页。有时提交后马上会提示运行成功,有时提交后就没有反映了。这个是程序问题,还是iis设置不当呢?
搜索更多相关主题的帖子: 网页 
2013-12-03 16:51
ysf0181
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:55
帖 子:914
专家分:2385
注 册:2006-10-4
收藏
得分:0 
检查IIs 应用程序配置,调试标志,两个钩,不能选上。

ASP讨论QQ群:251346273
2013-12-04 14:55
gaoxiaoweb
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2013-12-3
收藏
得分:0 
我有查看,这两个勾是没有勾选的。

这都几天了,我还是没有找到原因。
2013-12-07 10:57
ysf0181
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:55
帖 子:914
专家分:2385
注 册:2006-10-4
收藏
得分:0 
代码,贴上来。

ASP讨论QQ群:251346273
2013-12-07 10:58
gaoxiaoweb
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2013-12-3
收藏
得分:0 
我把程序贴出来,各位帮忙看看吧!
   if lcase(request.servervariables("HTTPS"))= "off" then
      strtemp="http://"
   else
      strtemp="https://"
   end if
   if lcase(request.servervariables("SERVER_NAME"))="localhost" then
      strtemp=strtemp&"127.0.0.1"
   else
      strtemp=strtemp&trim(request.servervariables("SERVER_NAME"))
  end if   

         set cs=server.createobject("adodb.recordset")
         csql="select * from aa where fl='bb'"
         cs.open csql,conn,1,3
         
         set fso=server.createobject("scripting.filesystemobject")
         if not (cs.bof and cs.eof) then
           for c=1 to cs.recordcount
              if trim(cs("html"))="" or isnull(cs("html")) then  ‘html基本不为空,如果为空的话,则生成路径
                 fpath="wzfl/"&trim(getpy(trim(cs("xlmc")))) 'getpy是一个生成路径的函数,
                 path="/"&fpath&"/"
                 if not fso.folderexists(server.mappath(path)) then
                    fso.CreateFolder(server.mappath(path))
                 end if
                 if trim(cs("html"))="" or isnull(cs("html")) then
                    cs("html")=path
                    cs.update
                 end if
               else
                  path=trim(cs("html"))        
               end if
                    
                url=strtemp&"/newwzfl.asp?wzlx="&trim(cs("id"))  '根据传过去的参数生成相应的内容
                sql="select * from wzljl where lxx="&trim(cs("id"))
                mysl=25
                path=path
                call sclist(url,sql,mysl,path,"fl")                                                
           cs.movenext
           next
           response.write "<script>alert('文字分类全部生成,共"&cs.recordcount&"个分类');</script>"           
         end if
         cs.close
         set cs=nothing
         set csql=nothing
         set fso=nothing

sub sclist(url,sql,mysl,path,fl)
  if not isobject(conn) then connectiondatabase
  set ors=server.createobject("adodb.recordset")
  osql=sql
  ors.open osql,conn,1,1

  if not (ors.bof and ors.eof) then
    me_record=mysl
    if (ors.recordcount) mod me_record = 0 then
       zpage=int((ors.recordcount)/me_record)
    else
       zpage=int((ors.recordcount)/me_record)+1
    end if
  
    for j=1 to zpage
       Set Http = CreateObject("Msxml2.ServerXMLHTTP.3.0")   
       set objstream = Server.CreateObject("adodb.stream")   
       if j=1 then
           filename="\index.htm"
       else
           filename="\list_"&j&".htm"
       end if
       fpath=server.mappath(path)
     
       fileurl=fpath&filename   
            
       lResolve = 500 * 1000
       lConnect = 500 * 1000
       lSend = 1500 * 1000
       lReceive = 1500 * 1000
       Http.setTimeouts lResolve, lConnect, lSend, lReceive  
      
       if fl="fl" then
          web=url&"&page="&j
       else
         web=url&"?page="&j
       end if     
      
       Http.open  "GET" ,web,false
       Http.send()
       html_code=Http.responseBody
     
       objstream.Type = 1   
       objstream.Mode =3      
       objstream.Open   
       objstream.Write html_code   
       objstream.Position = 0     
       objstream.Type = 2   
       objstream.Charset = "GB2312"      
      
       objstream.SaveToFile(fileurl),2
       'response.write fileurl&"   写入成功!<br>"
        objstream.close
       set objstream=nothing
       set Http=nothing   
    next
  end if  
  ors.close
  set ors=nothing
  set osql=nothing
end sub
2013-12-07 11:06
ysf0181
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:55
帖 子:914
专家分:2385
注 册:2006-10-4
收藏
得分:0 
函数内的变量,用
dim

整个页面<% option explicit %>


对变量类型,进行严格检查,不放过一个变量。


asp就这点不好,变量类型不搞,大型写法很容易出错。

ASP讨论QQ群:251346273
2013-12-07 11:28
gaoxiaoweb
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2013-12-3
收藏
得分:0 
我对所有涉及到的页面全部查了,没有重复使用的变量。

我试一下函数内使用强制定义变量吧!看看结果怎么样
2013-12-07 16:52
gaoxiaoweb
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2013-12-3
收藏
得分:0 
版主你好,我测试了几次,发现这个路径里面有打开读取数据库内容的就会假死,没有反映。只要不涉及到打开数据库很快就会运行完成。
url=strtemp&"/newwzfl.asp?wzlx="&trim(cs("id"))  '根据传过去的参数生成相应的内容


for c=1 to cs.recordcount最外围的这个for,如果循环次数不多(6次),上面既使有打开数据库的也不会假死,很快就会完成。一但循环次数过多,就会假死(程序中最多为20个循环)。

这是啥子原因呢?
2013-12-12 11:43
gaoxiaoweb
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2013-12-3
收藏
得分:0 
如下是newwzfl.asp里面的内容,是做测试使用的,原文件中会有好多次打开关闭数据库的动作。如下是测试的,运行的时候,我等了半个小时,还是没有反映。

page=request.querystring("page")
wzlx=request.querystring("wzlx")
response.write page&"<br>"&wzlx&"<br>"
                  
                 call conn()
                 set rs=server.createobject("adodb.recordset")
                 sql="select xlmc,html from xfl where fl='bxxh'"
                 rs.open sql,conn,1,1
                 
                 if not (rs.bof and rs.eof) then
                   for b=1 to rs.recordcount
                     response.write "<li><a href='"&trim(rs("html"))&"'>"&trim(rs("xlmc"))&"</a></li>"
                   rs.movenext
                   next
                 end if
                 rs.close
                 set rs=nothing
                 set sql=nothing
                conn.close
                set conn=nothing

[ 本帖最后由 gaoxiaoweb 于 2013-12-12 13:17 编辑 ]
2013-12-12 11:54
gaoxiaoweb
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2013-12-3
收藏
得分:0 
现在能用了,但还是不太理想

我把所有的rs.open都改成了conn.execute 然后增加了Server.ScriptTime=9999

同一个操作,有时点提交后,很快就运行完了,有时确还需要等上半人小时。
2013-12-21 17:13
快速回复:asp假死现象!
数据加载中...
 
   



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

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