| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1633 人关注过本帖
标题:Response.Flush问题
只看楼主 加入收藏
Johnsylm
Rank: 2
等 级:论坛游民
威 望:4
帖 子:26
专家分:20
注 册:2008-12-12
结帖率:100%
收藏
 问题点数:0 回复次数:7 
Response.Flush问题
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
' 虹桥医院网站后台程序生成列表
' 由 Johnsylm 结合多种资源精心打造
'--------------------------------------------------
' 适用于大型网站并生成静态 html
'---------------------------------------------------
Response.IsClientConnected
%>
<!--#include file="conn_news.asp" -->
<!--#include file="conn.asp"-->
<%
  Response.Write("<div id='temp' style='width:100%;height:530px;background-image:url(AdminImage/hh_03.jpg);background-repeat:no-repeat;left:0;right:0;margin-top:0px;text-align:center;'>")
  Response.write("<div style='margin-top:200px;'>")
  Response.Write("<img src='AdminImage/many.gif' style='margin-bottom:5px;'><br />")
  Response.write("<span id='tempNum' style='line-height:17px;'>")
  Response.write("生成文件大约需要 1 分钟的时间,请耐心等待!")
  Response.write("</span></div></div>")

%>
<%

dim rs_string1,rs_string2,rs_string3,rs_string4,rs_string5
dim String1,String2,String3,String4,String5
Set rs_string1 = server.CreateObject("adodb.recordset")
rs_string1.open "select * from m_writer where m_rider ='k1'",conn,1,1
String1 = rs_string1("m_content")
rs_string1.Close
Set rs_string1 = Nothing

Set rs_string2 = server.CreateObject("adodb.recordset")
rs_string2.open "select * from m_writer where m_rider ='k2'",conn,1,1
String2 = rs_string2("m_content")
rs_string2.Close
Set rs_string2 = Nothing

Set rs_string3 = server.CreateObject("adodb.recordset")
rs_string3.open "select * from m_writer where m_rider ='k3'",conn,1,1
String3 = rs_string3("m_content")
rs_string3.Close
Set rs_string3 = Nothing

Set rs_string4 = server.CreateObject("adodb.recordset")
rs_string4.open "select * from m_writer where m_rider ='k4'",conn,1,1
String4 = rs_string4("m_content")
rs_string4.Close
Set rs_string4 = Nothing

Set rs_string5 = server.CreateObject("adodb.recordset")
rs_string5.open "select * from m_writer where m_rider ='k5'",conn,1,1
String5 = rs_string5("m_content")
rs_string5.Close
Set rs_string5 = Nothing

dim rs_hots,hots_String,rs_Abouts,Abouts_String
Set rs_hots = server.CreateObject("adodb.recordset")
rs_hots.open "select * from m_writer where m_rider ='a2'",conn,1,1
hots_String = rs_hots("m_content")
rs_hots.Close
Set rs_hots = Nothing

Set rs_Abouts = server.CreateObject("adodb.recordset")
rs_Abouts.open "select * from m_writer where m_rider ='a1'",conn,1,1
Abouts_String = rs_Abouts("m_content")
rs_Abouts.Close
Set rs_Abouts = Nothing

Dim rs_Friends,Friends_String
Set rs_Friends = server.CreateObject("adodb.recordset")
rs_Friends.open "select * from m_writer where m_rider ='f1'",conn,1,1
Friends_String = rs_Friends("m_content")
rs_Friends.Close
Set rs_Friends = Nothing
%>

<%if session("Plogin")<>"OK" then%>
<script language=Javascript>
alert("请先登陆!");
parent.location.href="login.asp";
</script>
<%
Response.End()
Else
%>

<%
dim startime
startime=timer()
Server.ScriptTimeout=10000

dim NumI
NumI = 1

Dim rsn
Dim rsn_numRows

Set rsn = Server.CreateObject("ADODB.Recordset")
rsn.ActiveConnection = MM_conn_news_STRING
rsn.Source = "SELECT *  FROM (t_news inner join t_type on t_news.n_tid = t_type.t_id) inner join t_type_son on t_news.n_tsid = t_type_son.ts_id "
rsn.CursorType = 0
rsn.CursorLocation = 2
rsn.LockType = 1
rsn.Open()

rsn_numRows = 0
%>

<%
'新增功能  读取上一篇和下一篇文章标题链接
Dim rs

Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_conn_news_STRING
rs.Source = "SELECT *  FROM (t_news inner join t_type on t_news.n_tid = t_type.t_id) inner join t_type_son on t_news.n_tsid = t_type_son.ts_id "
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()

titleprev="没有文章了"
'结束
%>

<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rsn_numRows = rsn_numRows + Repeat1__numRows
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>生成新闻页</title>
<style type="text/css">
<!--
body,td,th {
    font-size: 12px;
    background-image: url(BackGround.jpg);
    scrollbar-face-color: #C9E8FD;
    scrollbar-shadow-color: #D8E2E7;
    scrollbar-highlight-color: #FFFFFF;
    scrollbar-3dlight-color: #92BCE4;
    scrollbar-darkshadow-color: #91BDE4;
    scrollbar-base-color:#F0F9FF;
    scrollbar-arrow-color: #92BCE4;
}
a {
    font-size: 12px;
}
a:link {
    text-decoration: none;
}
a:visited {
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
a:active {
    text-decoration: none;
}
.MenuFont {
    font-family: "宋体";
    font-size: 14px;
    line-height: 18px;
    color: #0053A9;
}
.ContentFont {
    font-family: "宋体";
    font-size: 14px;
    line-height: 24px;
    color: #086CCA;
}
-->
</style></head>
<body leftmargin="0" rightmargin="0" bottommargin="0" topmargin="0" style="overflow-y:scroll;">
<table width="815" border="0" style="background-repeat:no-repeat;" cellpadding="0" cellspacing="0" background="AdminImage/BackGround_Main.jpg">
  <!--DWLayoutTable-->
  <tr>
    <td height="26" colspan="2" align="left" valign="bottom" class="MenuFont" style="padding-left:15px;">&nbsp;<b>您的位置:虹桥医院后台管理&nbsp;-&gt;&nbsp;生成具体新闻页!</b></td>
    <td width="13">&nbsp;</td>
  </tr>
  <tr>
    <td width="11" height="14">&nbsp;</td>
    <td width="791">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="650">&nbsp;</td>
    <td valign="top" class="ContentFont">
<ul>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsn.EOF))
%>
<%
'新增功能,读取分类列表
Dim rsts_nav_all
Set rsts_nav_all = Server.CreateObject("ADODB.Recordset")
rsts_nav_all.ActiveConnection = MM_conn_news_STRING
rsts_nav_all.Source = "SELECT * FROM t_type inner join t_type_son on t_type.t_id=t_type_son.ts_pid WHERE ts_pid = " + Replace(rsn.Fields.Item("t_id").value, "'", "''") + ""
rsts_nav_all.CursorType = 0
rsts_nav_all.CursorLocation = 2
rsts_nav_all.LockType = 1
rsts_nav_all.Open()

'生成小类导航菜单
dim mm_nav2,mm_nav2_i
mm_nav2 = ""
mm_nav2_i = 1
do while mm_nav2_i<7 and not rsts_nav_all.eof
  if mm_nav2_i =1 then
    mm_nav2=mm_nav2&"<ul class='firstUL'><div style='background-color: rgb(0, 0, 0); width: 2px; float: left; height: 38px;'><img src='/images/ygmk.gif' width='2' height='38'></div><li><a href='/"&(rsts_nav_all.Fields.Item("t_dir").Value)&"/"&(rsts_nav_all.Fields.Item("ts_dir").Value)&"/list_1.htm'><span style='font-size: 15px; color:#012744;'><b>"&rsts_nav_all.Fields.Item("ts_name").value&"</b></span></a></li><li><span style='font-family: Arial; font-size: 11px; color: rgb(55, 129, 179);'>Prostate </span></li></ul>"
  else
    mm_nav2=mm_nav2&"<ul><li><a href='/"&(rsts_nav_all.Fields.Item("t_dir").Value)&"/"&(rsts_nav_all.Fields.Item("ts_dir").Value)&"/list_1.htm'><span style='font-size: 15px; color:#012744;'><b>"&rsts_nav_all.Fields.Item("ts_name").value&"</b></span></a></li><li><span style='font-family: Arial; font-size: 11px; color: rgb(55, 129, 179);'>Prostate </span></li></ul>"
'    mm_nav2=mm_nav2&" <a href="&chr(34)&"../"&(rsts_nav_all.Fields.Item("ts_dir").Value)&"/list_1.htm"&chr(34)&" class="&chr(34)&yns_list_nav2_class&chr(34)&">"&(rsts_nav_all.Fields.Item("ts_name").Value)&"</a> "&" | "
  end if
  mm_nav2_i=mm_nav2_i+1
  rsts_nav_all.movenext
loop

rsts_nav_all.Close
Set rsts_nav_all = Nothing
%>

<%
''新增功能 读取热点新闻和推荐新闻 By Johnsylm
'dim rs_hot,hot_string,hot_i
'Set rs_hot = Server.CreateObject("ADODB.Recordset")
'rs_hot.ActiveConnection = MM_conn_news_STRING
'rs_hot.Source = "SELECT *  FROM (t_news inner join t_type on t_news.n_tid = t_type.t_id) inner join t_type_son on t_news.n_tsid = t_type_son.ts_id where ts_id="&rsn.Fields.Item("ts_id").value&" and n_commend="&rsn.Fields.Item("n_commend").value&""
'rs_hot.CursorType = 0
'rs_hot.CursorLocation = 2
'rs_hot.LockType = 1
'rs_hot.Open()
'
'for hot_i =1 to 7
'  if not rs_hot.eof then
'    hot_string=hot_string&"·&nbsp;<a href='/"&rs_hot.Fields.Item("t_dir").value&"/"&rs_hot.Fields.Item("ts_dir").value&"/"&rs_hot.Fields.Item("n_fpath").value&"/"&rs_hot.Fields.Item("n_fname").value&"'>"&rs_hot.Fields.Item("n_title").value&"</a><br>"
'    rs_hot.movenext
'  end if
'next
'
''新增功能 读取相关文章 By Johnsylm
'dim rs_abouts,abouts_string,abouts_i
'Set rs_abouts = Server.CreateObject("ADODB.Recordset")
'rs_abouts.ActiveConnection = MM_conn_news_STRING
'rs_abouts.Source = "SELECT *  FROM (t_news inner join t_type on t_news.n_tid = t_type.t_id) inner join t_type_son on t_news.n_tsid = t_type_son.ts_id"
'rs_abouts.CursorType = 0
'rs_abouts.CursorLocation = 2
'rs_abouts.LockType = 1
'rs_abouts.Open()
'
'for abouts_i =1 to 7
'  if not rs_abouts.eof then
'    abouts_string=abouts_string&"·&nbsp;<a href='/"&rs_abouts.Fields.Item("t_dir").value&"/"&rs_abouts.Fields.Item("ts_dir").value&"/"&rs_abouts.Fields.Item("n_fpath").value&"/"&rs_abouts.Fields.Item("n_fname").value&"'>"&rs_abouts.Fields.Item("n_title").value&"</a><br>"
'    rs_abouts.movenext
'  end if
'next
%>


<%
'新增功能  读取上一篇和下一篇文章标题链接
if (titlethis <> "") then
    titleprev=titlethis
end if
if (not rs.eof) then
    titlethis="<a href=/"&(rs.Fields.Item("t_dir").Value)&"/"&(rs.Fields.Item("ts_dir").Value)&"/"&(rs.Fields.Item("n_fpath").Value)&"/"&(rs.Fields.Item("n_fname").Value)&">"&(rs.Fields.Item("n_title").Value)&"</a>"
    rs.Movenext()
    if (not rs.eof) then
        titlenext="<a href=/"&(rs.Fields.Item("t_dir").Value)&"/"&(rs.Fields.Item("ts_dir").Value)&"/"&(rs.Fields.Item("n_fpath").Value)&"/"&(rs.Fields.Item("n_fname").Value)&">"&(rs.Fields.Item("n_title").Value)&"</a>"
    else
        titlenext="没有文章了"
    end if
end if
'结束

'Johnsylm 新增功能:自定义关键词、标签 -- 开始
    dim n_keywords
    dim mm_n_keywords
    dim n_tag
    dim mm_n_tag
    dim temp_n_tag
    dim mm_temp_n_tag
    

    if IsNull(rsn.Fields.Item("n_keywords").Value) then
        mm_n_keywords="上海医院,泌尿科,泌尿疾病,男科,急慢性前列腺炎,前列腺炎,前列腺,前列腺增生,龟头,膀胱炎,包皮包茎,阴茎,包皮,包茎,阴茎延长术,性功能,射精障碍,阳痿,早泄,无痛杀菌微波热疗,彻底治疗尿道炎不复发"
    else
        mm_n_keywords=replace((rsn.Fields.Item("n_keywords").Value),",",",")
        mm_n_keywords=replace(mm_n_keywords,space(1),",")
    end If
    
    if IsNull(rsn.Fields.Item("n_tag").Value) then
        mm_temp_n_tag="<a href='/hqnews_taglist.asp?title="&Server.URLEncode("虹桥医院")&"' target='_blank'><font color='#000000'><b>虹桥医院</b></font></a>,<a href='/hqnews_taglist.asp?title="&Server.URLEncode("男科")&"' target='_blank'><font color='#000000'><b>男科</b></font></a>,<a href='/hqnews_taglist.asp?title="&Server.URLEncode("泌尿科")&"' target='_blank'><font color='#000000'><b>泌尿科</b></font></a>,<a href='/hqnews_taglist.asp?title="&Server.URLEncode("上海虹桥医院")&"' target='_blank'><font color='#000000'><b>上海虹桥医院</b></font></a>,<a href='/hqnews_taglist.asp?title="&Server.URLEncode("沪上男科医院")&"' target='_blank'><font color='#000000'><b>沪上男科医院</b></font></a>"
    else
        mm_temp_n_tag=""
        mm_n_tag=replace(rsn.Fields.Item("n_tag").Value,",",",")
        mm_n_tag=replace(mm_n_tag,space(1),",")
        temp_n_tag=split(mm_n_tag,",")
        For tag_i = LBound(temp_n_tag) To UBound(temp_n_tag)
            If tag_i <> UBound(temp_n_tag) then
                mm_temp_n_tag = mm_temp_n_tag &"<a href='/hqnews_taglist.asp?title="&Server.URLEncode(temp_n_tag(tag_i))&"' target='_blank'><b><font color='#000000'>"&temp_n_tag(tag_i)&"</font></b></a><font color='#000000'><b>,</b></font>"
            Else
            mm_temp_n_tag = mm_temp_n_tag &"<a href='/hqnews_taglist.asp?title="&Server.URLEncode(temp_n_tag(tag_i))&"' target='_blank'><b><font color='#000000'>"&temp_n_tag(tag_i)&"</font></b></a>"
            End If
        Next
    end if
'Johnsylm 新增功能:为页面加上合适的关键词、标签。
%>

      <%
      dim mmdd_path
      dim mmdd_fpath
      dim mmdd_tspath
      dim mmdd_tpath
      dim mm_template_path
      mm_template_path = server.MapPath("TempLates/nknew2.htm")
      mmdd_path=server.MapPath((rsn.Fields.Item("t_dir").Value)&"/"&(rsn.Fields.Item("ts_dir").Value)&"/"&(rsn.Fields.Item("n_fpath").Value)&"/"&(rsn.Fields.Item("n_fname").Value))
     mmdd_fpath=server.MapPath((rsn.Fields.Item("t_dir").Value)&"/"&(rsn.Fields.Item("ts_dir").Value)&"/"&(rsn.Fields.Item("n_fpath").Value))
      mmdd_tspath=server.MapPath((rsn.Fields.Item("t_dir").Value)&"/"&(rsn.Fields.Item("ts_dir").Value))
      mmdd_tpath=server.MapPath(rsn.Fields.Item("t_dir").Value)
     ' response.Write(mmdd_fpath)
      Set fso = Server.CreateObject("Scripting.FileSystemObject")
    
t_stype="<a href='/"&rsn.Fields.Item("t_sidr").value&"'>"&rsn.Fields.Item("t_name").value&"</a>"
author=(rsn.Fields.Item("n_author").Value)
fname = (rsn.Fields.Item("n_fname").Value)
hname = (rsn.Fields.Item("n_fname").Value)
N_Title=(rsn.Fields.Item("n_title").Value)
'新增功能  读取新闻简述
n_desc=(rsn.Fields.Item("n_desc").Value)
littletitle=(rsn.Fields.Item("n_Small").Value)
'新增功能  新闻留言功能
n_id=(rsn.Fields.Item("n_id").Value)

n_content=(rsn.Fields.Item("n_content").Value)
n_date=(rsn.Fields.Item("n_date").Value)
fpath=(rsn.Fields.Item("n_fpath").Value)

n_type="<a href='/"&rsn.Fields.Item("t_dir").value&"/"&(rsn.Fields.Item("ts_dir").value)&"/list_1.htm'>"&(rsn.Fields.Item("ts_name").Value)&"</a>"
jsnumber=(rsn.Fields.Item("n_tsid").Value)

 if not(fso.FileExists(mm_template_path))  then
 
%>
<script language=javascript>  
alert( "生成失败,模板文件不存在!"  );
location.href = "javascript:history.back()"   
</script>
<%
else
  set fso_line = fso.opentextfile(mm_template_path,1,True)
  pencat=fso_line.readall
end if

if (rsn.Fields.Item("n_pages") <> 0) and (rsn.Fields.Item("n_pages").value<>"") then
  dim HowContent,HowPage_i
  HowContent = n_content
  HowContent = split(n_content,"<hr />")
  HowPage = ubound(HowContent)
end if

if (rsn.Fields.Item("n_pages").value) <> 0 then

  for TempI = 0 to HowPage
    if TempI = 0 then
      HowPageString = HowPageString&"<a href='/"&rsn.Fields.Item("t_dir").Value&"/"&rsn.Fields.Item("ts_dir").Value&"/"&rsn.Fields.Item("n_fpath").Value&"/"&rsn.Fields.Item("n_fname").value&"'>"&TempI+1&"</a> "
    else
    HowPageString = HowPageString&"<a href='/"&rsn.Fields.Item("t_dir").Value&"/"&rsn.Fields.Item("ts_dir").Value&"/"&rsn.Fields.Item("n_fpath").Value&"/"&TempI&"_"&rsn.Fields.Item("n_fname").Value&"'>"&TempI+1&"</a> "
    end if
  next

  for HowPage_i=0 to (rsn.Fields.Item("n_pages").value)
  
    tempString = replace(HowPageString,"<a href='/"&rsn.Fields.Item("t_dir").Value&"/"&rsn.Fields.Item("ts_dir").Value&"/"&rsn.Fields.Item("n_fpath").Value&"/"&rsn.Fields.Item("n_fname").Value&"'>"&HowPage_i+1&"</a> ","<a href='/"&type_dir&"/"&type_son_dir&"/"&rsn.Fields.Item("n_fpath").Value&"/"&rsn.Fields.Item("n_fname").Value&"'><font color='#000'><b>"&HowPage_i+1&"</b></font></a> ")
    tempString2 = replace(HowPageString,"<a href='/"&rsn.Fields.Item("t_dir").Value&"/"&rsn.Fields.Item("ts_dir").Value&"/"&rsn.Fields.Item("n_fpath").Value&"/"&HowPage_i&"_"&rsn.Fields.Item("n_fname").Value&"'>"&HowPage_i+1&"</a> ","<a href='/"&type_dir&"/"&type_son_dir&"/"&rsn.Fields.Item("n_fpath").Value&"/"&HowPage_i&"_"&rsn.Fields.Item("n_fname").Value&"'><font color='#000'><b>"&HowPage_i+1&"</b></font></a> ")
  
    if HowPage_i = 0 then
      set fso_line = fso.opentextfile(mm_template_path,1,True)
      pencat=fso_line.readall
      pencat=replace(pencat,"nt_title",n_title)
      pencat=replace(pencat,"t_title",n_title)
      pencat=replace(pencat,"t_anthor",author)
      pencat=replace(pencat,"t_content",HowContent(HowPage_i))
      pencat=replace(pencat,"y_pagelist","<br />&nbsp;<br /><div id='yy'><b>请选择页码:</b>"&tempString&"</div>")
      pencat=replace(pencat,"t_time",n_date)
      pencat=replace(pencat,"t_name",hname)

      if littletitle<>"" then
        pencat=replace(pencat,"t_littletitle","<div id='biaoti2'>"&littletitle&"</div>")
      else
        pencat=replace(pencat,"t_littletitle","<div style='display:none'>&nbsp;</div>")
      end if

      pencat=replace(pencat,"t_nav2",mm_nav2)

      pencat=replace(pencat,"n_keywords",mm_n_keywords) '读取数据库关键词 //Johnsylm 注。(新增功能,Johnsylm 增)
      pencat=replace(pencat,"n_tag",mm_temp_n_tag) '读取数据库标签 //Johnsylm 注。 (新增功能,Johnsylm 增)
      pencat=replace(pencat,"t_stype",t_stype)

      pencat=replace(pencat,"t_type_son",n_type)
      pencat=replace(pencat,"n_list_hot",hots_String)
      pencat=replace(pencat,"n_list_abouts",Abouts_String)
      pencat=replace(pencat,"k_string1",String1)
      pencat=replace(pencat,"k_string2",String2)
      pencat=replace(pencat,"k_string3",String3)
      pencat=replace(pencat,"k_string4",String4)
      pencat=replace(pencat,"k_string5",String5)
      pencat=replace(pencat,"n_yqlj",Friends_String)

'新增功能  读取上一篇和下一篇文章标题链接
      pencat=replace(pencat,"titleprev",titleprev)
      pencat=replace(pencat,"titlenext",titlenext)
'新增功能  替换文章简述
      pencat=replace(pencat,"n_desc",n_desc)
'新增功能  新闻留言功能
      pencat=replace(pencat,"n_id",n_id)
'

      if not fso.FolderExists(mmdd_tpath) then
        fso.CreateFolder (mmdd_tpath)
      end if
      if not fso.FolderExists(mmdd_tspath) then
        fso.CreateFolder (mmdd_tspath)
      end if
      if not fso.FolderExists(mmdd_fpath) then
        fso.CreateFolder (mmdd_fpath)
      end if
      Set fout = fso.CreateTextFile(mmdd_path)
      fout.WriteLine pencat
      fout.close
      pencat = ""
      
    else
    
      set fso_line = fso.opentextfile(mm_template_path,1,True)
      pencat=fso_line.readall
      pencat=replace(pencat,"nt_title",n_title)
      pencat=replace(pencat,"t_title",n_title)
      pencat=replace(pencat,"t_anthor",author)
      pencat=replace(pencat,"t_content",HowContent(HowPage_i))
      pencat=replace(pencat,"y_pagelist","<br />&nbsp;<br /><div id='yy'><b>请选择页码:</b>"&tempString2&"</div>")
      pencat=replace(pencat,"t_time",n_date)
      pencat=replace(pencat,"t_name",hname)

      if littletitle<>"" then
        pencat=replace(pencat,"t_littletitle","<div id='biaoti2'>"&littletitle&"</div>")
      else
        pencat=replace(pencat,"t_littletitle","<div style='display:none'>&nbsp;</div>")
      end if

      pencat=replace(pencat,"t_nav2",mm_nav2)

      pencat=replace(pencat,"n_keywords",mm_n_keywords) '读取数据库关键词 //Johnsylm 注。(新增功能,Johnsylm 增)
      pencat=replace(pencat,"n_tag",mm_temp_n_tag) '读取数据库标签 //Johnsylm 注。 (新增功能,Johnsylm 增)
      pencat=replace(pencat,"t_stype",t_stype)

      pencat=replace(pencat,"t_type_son",n_type)
      pencat=replace(pencat,"n_list_hot",hots_String)
      pencat=replace(pencat,"n_list_abouts",Abouts_String)
      pencat=replace(pencat,"k_string1",String1)
      pencat=replace(pencat,"k_string2",String2)
      pencat=replace(pencat,"k_string3",String3)
      pencat=replace(pencat,"k_string4",String4)
      pencat=replace(pencat,"k_string5",String5)
      pencat=replace(pencat,"n_yqlj",Friends_String)

'新增功能  读取上一篇和下一篇文章标题链接
      pencat=replace(pencat,"titleprev",titleprev)
      pencat=replace(pencat,"titlenext",titlenext)
'新增功能  替换文章简述
      pencat=replace(pencat,"n_desc",n_desc)
'新增功能  新闻留言功能
      pencat=replace(pencat,"n_id",n_id)
'
      mmdd_path = ""
      mmdd_path=server.MapPath((rsn.Fields.Item("t_dir").Value)&"/"&(rsn.Fields.Item("ts_dir").Value)&"/"&(rsn.Fields.Item("n_fpath").Value)&"/"&HowPage_i&"_"&(rsn.Fields.Item("n_fname").Value))
      Set fout = fso.CreateTextFile(mmdd_path)
      fout.WriteLine pencat
      fout.close
      pencat = ""
    end if
    tempString = ""
    tempString2 = ""
  next
  HowPageString = ""
  
else
  
  set fso_line = fso.opentextfile(mm_template_path,1,True)
  pencat=fso_line.readall
  pencat=replace(pencat,"nt_title",n_title)
  pencat=replace(pencat,"t_title",n_title)
  pencat=replace(pencat,"t_anthor",author)
  pencat=replace(pencat,"t_content",n_content)
  pencat=replace(pencat,"y_pagelist","<div style='display:none'>不显示</div>")
  pencat=replace(pencat,"t_time",n_date)
  pencat=replace(pencat,"t_name",hname)

  if littletitle<>"" then
    pencat=replace(pencat,"t_littletitle","<div id='biaoti2'>"&littletitle&"</div>")
  else
    pencat=replace(pencat,"t_littletitle","<div style='display:none'>&nbsp;</div>")
  end if

  pencat=replace(pencat,"t_nav2",mm_nav2)

  pencat=replace(pencat,"n_keywords",mm_n_keywords) '读取数据库关键词 //Johnsylm 注。(新增功能,Johnsylm 增)
  pencat=replace(pencat,"n_tag",mm_temp_n_tag) '读取数据库标签 //Johnsylm 注。 (新增功能,Johnsylm 增)
  pencat=replace(pencat,"t_stype",t_stype)

  pencat=replace(pencat,"t_type_son",n_type)
  pencat=replace(pencat,"n_list_hot",hots_String)
  pencat=replace(pencat,"n_list_abouts",Abouts_String)
  pencat=replace(pencat,"k_string1",String1)
  pencat=replace(pencat,"k_string2",String2)
  pencat=replace(pencat,"k_string3",String3)
  pencat=replace(pencat,"k_string4",String4)
  pencat=replace(pencat,"k_string5",String5)
  pencat=replace(pencat,"n_yqlj",Friends_String)

'新增功能  读取上一篇和下一篇文章标题链接
  pencat=replace(pencat,"titleprev",titleprev)
  pencat=replace(pencat,"titlenext",titlenext)
'新增功能  替换文章简述
  pencat=replace(pencat,"n_desc",n_desc)
'新增功能  新闻留言功能
  pencat=replace(pencat,"n_id",n_id)
'

  if not fso.FolderExists(mmdd_tpath) then
    fso.CreateFolder (mmdd_tpath)
  end if
  if not fso.FolderExists(mmdd_tspath) then
    fso.CreateFolder (mmdd_tspath)
  end if
  if not fso.FolderExists(mmdd_fpath) then
    fso.CreateFolder (mmdd_fpath)
  end if
  mmdd_path = ""
  mmdd_path=server.MapPath((rsn.Fields.Item("t_dir").Value)&"/"&(rsn.Fields.Item("ts_dir").Value)&"/"&(rsn.Fields.Item("n_fpath").Value)&"/"&(rsn.Fields.Item("n_fname").Value))
  Set fout = fso.CreateTextFile(mmdd_path)
  fout.WriteLine pencat
  fout.close

end if

Set fso = Nothing
'hot_string=""'清空推荐新闻
'abouts_string=""'清空相关文章
mm_nav2=""'列表清空
      %>
  <li class="lh"> <%= ((rsn.Fields.Item("t_dir").Value)&"/"&(rsn.Fields.Item("ts_dir").Value)&"/"&(rsn.Fields.Item("n_fpath").Value)&"/"&(rsn.Fields.Item("n_fname").Value)) %> <font color="#FF0000">被创建(覆盖式创建)</font></li>
<%
  Response.Flush()
  Response.Clear()

  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  NumI = NumI + 1
  rsn.MoveNext()
Wend
%></ul>
</body>
</html>
<%
rsn.Close()
Set rsn = Nothing
%>
<%
rs.Close()
Set rs = Nothing

'rs_hot.Close()
'Set rs_hot = Nothing
'
'rs_abouts.Close()
'Set rs_abouts = Nothing

dim endtime,fileTimeAll
endtime=timer()
fileTimeAll=FormatNumber((endtime-startime)*1000,3)
Response.write("生成所有文件所需时间为:"&fileTimeAll&"&nbsp;微秒!<br>")
Response.write("-------------------------------------------------------------------------------------------------------------<br>")
Response.write("执行时间精确至微秒,共生成:"&NumI&"&nbsp;个文件!<br>如果该文件执行时间超过&nbsp;180&nbsp;秒,那么请检查服务器状态或隔20分钟后再次进行生成操作。")
%>
    </td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="769">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<script type="text/javascript">
document.getElementById("temp").style.display="none";
</script>
</body>
</html>
<%End If%>

这个是后台生成静态文件用的
一共输出2000多个HTM文件,每个都挺大的,所以生成过程要1分多钟!这一分多种里就是白屏!
我想在输出一个文件就让变量加一,然后用当前变量除以整个条数得出一个进度条。

可是输出时候都是白屏!然后我看到Response.Flush可以强制性输出,我就试了一下,发现结果是一样的!
然后又说必须要达到256字节才可以输出!我就又在头上加了一个输出,绝对远远大于256字节了,可是还是没用!另外,以前Response.Flush之前都是Response.write的!但是还是没用,希望高手能给我解释!谢谢!

QQ:825313100
网站:http://www.
搜索更多相关主题的帖子: Flush Response 在线 
2008-12-13 07:57
lackyking
Rank: 3Rank: 3
等 级:新手上路
威 望:6
帖 子:186
专家分:0
注 册:2008-7-1
收藏
得分:0 
ASP是在服务器上解释后发送HTML给客户端浏览器的,
所以你在浏览器上看到的只能是已经执行完毕的结果,
要实现进度条,可以用搜索一下XMLHttpRequest/Ajax相关信息

http://www.,木公博客
2008-12-13 11:42
Johnsylm
Rank: 2
等 级:论坛游民
威 望:4
帖 子:26
专家分:20
注 册:2008-12-12
收藏
得分:0 
我想不是
如果说用xmlhttp,我认为还不如每生成一次刷新一下用Session记录信息,还会更容易。但是想下,2000多个比较大的htm页面生成,这么做效率是无法想象的,可能很多时候都刷新不过来。
你看,它生成后的网站是这个:http://www.
因为我之前一直在找这方面的文献。查到一个Response.Flush,作用是立刻输出Response缓冲区的内容。所以我抱着希望用了一下。不过还是没用
2008-12-13 12:21
lackyking
Rank: 3Rank: 3
等 级:新手上路
威 望:6
帖 子:186
专家分:0
注 册:2008-7-1
收藏
得分:0 
将Response.Clear删除试试呢?

http://www.,木公博客
2008-12-13 12:44
lackyking
Rank: 3Rank: 3
等 级:新手上路
威 望:6
帖 子:186
专家分:0
注 册:2008-7-1
收藏
得分:0 
Set fso = Nothing
'hot_string=""'清空推荐新闻
'abouts_string=""'清空相关文章
mm_nav2=""'列表清空

  Response.Flush()

      %>
  <li class="lh"> <%= ((rsn.Fields.Item("t_dir").Value)&"/"&(rsn.Fields.Item("ts_dir").Value)&"/"&(rsn.Fields.Item("n_fpath").Value)&"/"&(rsn.Fields.Item("n_fname").Value)) %> <font color="#FF0000">被创建(覆盖式创建)</font></li>
<%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  NumI = NumI + 1
  rsn.MoveNext()

http://www.,木公博客
2008-12-13 12:46
Johnsylm
Rank: 2
等 级:论坛游民
威 望:4
帖 子:26
专家分:20
注 册:2008-12-12
收藏
得分:0 
忒感谢了。
这个问题我还是没实现。呵呵。我现在用一个固定的倒计时器记时了。反正能看到个大概吧,差异不会超过10%,呵呵。
2008-12-14 19:05
Johnsylm
Rank: 2
等 级:论坛游民
威 望:4
帖 子:26
专家分:20
注 册:2008-12-12
收藏
得分:0 
Q号是多少?我++,以后可以一起讨论一下的。呵呵。
我的
QQ:825313100
MSN:Johnsylm@
2008-12-14 19:06
lackyking
Rank: 3Rank: 3
等 级:新手上路
威 望:6
帖 子:186
专家分:0
注 册:2008-7-1
收藏
得分:0 
回复 第6楼 Johnsylm 的帖子
<%
Dim m:m=0
For i=0 To 1000000000
    Response.Flush()
    Response.Write m&"<br>"
    m=m+1
Next
%>
我试了一下,可以有进度效果的啊。

http://www.,木公博客
2008-12-15 08:51
快速回复:Response.Flush问题
数据加载中...
 
   



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

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