<%
'=================================================================================
'                             +-生成某个类的所有分页-+
'函数：CreateHtml(classid,pagesizes)
'功能：生成某个类的所有分页
'参数：
'classid   		---栏目ID
'pagesizes 		---每页显示的记录个数
'=================================================================================
sub CreateHtml(classid,pagesizes)
	dim currentpage,TempArr,Tempdir,ListName,totalnum,pagenum,TempContWrit,dirArr
	dim parentlist,parentrootpath,classdir,newsHref,queryStr,curOffSet,c_keywords,c_desc
	Set fs=Server.CreateObject("Scripting.FileSystemObject")	
	Set rs = Server.CreateObject("adodb.recordset")
	sql="select templet,title,savedir,keywords,description from catalogs where id="&classid
	rs.open sql,conn,3,1
	if not rs.eof then
		Tempdir=rs("templet")
		ListName=rs("title")
		parentrootpath=rs("savedir")
		c_keywords=rs("keywords")
		c_desc=rs("description")
	else
		response.Write("没有找到栏目(id为:"&classid&")!<input type='button' value='继续发布 →' onclick="&Chr(34)&"javascript:location.href='send.asp'"&Chr(34)&">")
		response.End()
	end if
	rs.close()
	set rs=nothing
	'读取信息
	queryStr="select"
	if(MaxSendPage<>0) then
		queryStr=queryStr&" top "&(MaxSendPage*pagesizes)
	end if
	queryStr=queryStr&" title,linkurl,id,moditime,title_color,isoutlink from news where checked=1 and classid="&classid&" order by id desc"
	Set rs = Server.CreateObject("adodb.recordset")
	rs.open queryStr,conn,3,1
	if not rs.eof and not rs.bof then
		TempArr=rs.GetRows()
		totalnum=ubound(TempArr,2)+1'新闻总数	
	else
		totalnum=0			
	end if
	rs.close
	set rs=nothing
	
	pagenum=int((totalnum+pagesizes-1)/pagesizes)'获取总页数
	if(pagenum<1) then 
		pagenum=1
	end if
	if(MaxSendPage<>0 and pagenum>MaxSendPage) then
		pagenum=MaxSendPage
	end if
	response.write("总共"&totalnum&"条："&pagenum&"(页)"&"<br>")	
	'根据分类选择建立文件夹
	
	parentlist=Split(getparentlist(classid),"|")
	'response.Write(parentrootpath&"<br>")
	dirArr=split(parentrootpath,"/")
	for dirn=1 to ubound(dirArr)
		classdir=classdir&"/"&dirArr(dirn)
		call MakeDir(server.mappath(classdir))		
	next
	'读取模板内容
	If (fs.FileExists(server.mappath(Tempdir))) Then
		TempCont=ReadFromTextFile(server.mappath(Tempdir))
		'set file_r = fs.opentextfile(server.mappath(Tempdir),1,True)'读取模板文件
		'TempCont= file_r.ReadAll
		'file_r.close()
		'set file_r=nothing	
		'response.Write(TempCont)'打印模板内容
	else
		response.Write("没有找到模板文件："&server.mappath(Tempdir))
		response.End()
	end if
	if(TempCont<>"") then
		TempCont=replace(TempCont,"$keywords$",c_keywords)
		TempCont=replace(TempCont,"$description$",c_desc)
	else
		response.Write("错误，模板内容为空")
		response.End()
	end if
	'生成每页的HTML文件
	if totalnum<=0 then
		dim blankContent
		blankContent=TempCont
		'替换更新的内容						
		blankContent=replace(blankContent,"$NewsList$","暂时没有数据")		
		blankContent=ReplaceAllLabel(blankContent,classid)		
		blankContent=replace(blankContent,"$ShowPage$","")
		call SaveTextFile(server.mappath(parentrootpath)&"\index_1.htm",blankContent)
		'Set file_w = fs.CreateTextFile(server.mappath(parentrootpath)&"\index_1.htm",true)	
		'file_w.WriteLine(blankContent)
		'file_w.close
		'set file_w=nothing
		response.Write("文件成功保存至："&server.mappath(parentrootpath)&"\index_1.htm")
		response.Write("<br>查看：<a href="""&parentrootpath&"/index_1.htm"&""" target=""_blank"">点击查看效果</a><br>")'打印保存路径
	else	
		for currentpage=1 to pagenum
			TempContWrit=TempCont
			goPage="&nbsp;&nbsp;跳至第<select size=1 onChange=""javascript:window.location.href='index_'+(G_page.selectedIndex+1)+'.htm'"" name=""G_page"">"
			for go_n=1 to pagenum
				if(go_n=currentpage) then
					goPage=goPage&"<option value="""&go_n&""" selected>"&go_n&"</option>"
				else
					goPage=goPage&"<option value="""&go_n&""">"&go_n&"</option>"
				end if
			next
			goPage=goPage&"</select>页&nbsp;&nbsp;"
			GetNewsList=""
			for rows=0 to pagesizes-1
				curOffSet=(currentpage-1)*pagesizes+rows
				if (curOffSet>=totalnum) then
		  			exit for
		 		end if				
				newsHref=TempArr(1,curOffSet)
				GetNewsList=GetNewsList&"<li>"&Chr(13)
				GetNewsList=GetNewsList&"<span class=""col_right"">"&month(TempArr(3,curOffSet))&"-"&day(TempArr(3,curOffSet))&"</span>"&Chr(13)
				GetNewsList=GetNewsList&"<a href="&Chr(34)&newsHref&Chr(34)&" target="&Chr(34)&"_blank"&Chr(34)
				if(TempArr(4,curOffSet)<>"") then
					GetNewsList=GetNewsList&" style=""color: "&TempArr(4,curOffSet)&""""
				end if
				GetNewsList=GetNewsList&">· "&TempArr(0,curOffSet)&"</a>"&Chr(13)     			
				GetNewsList=GetNewsList&"</li>"&Chr(13)			
				if((rows+1) mod 5=0) then
					GetNewsList=GetNewsList&"<br />"&Chr(13)			
				end if
			next	
		
			'替换更新的内容						
			TempContWrit=replace(TempContWrit,"$NewsList$",GetNewsList)		
			TempContWrit=ReplaceAllLabel(TempContWrit,classid)
			if err.number>0 then
				response.Write(err.description)
			end if		
			TempContWrit=replace(TempContWrit,"$ShowPage$",""&showPage(currentpage,totalnum,pagenum)&goPage)
		
			'写入文件内容
			response.Write("文件成功保存到："&server.mappath(parentrootpath)&"\index_"&currentpage&".htm"&"<br>")'打印保存路径
			
			call SaveTextFile(server.mappath(parentrootpath)&"/index_"&currentpage&".htm",TempContWrit)
			'Set file_w = fs.CreateTextFile(server.mappath(parentrootpath)&"/index_"&currentpage&".htm",true)		
			'file_w.WriteLine(TempContWrit)
			'file_w.close
			'set file_w=nothing
		next
	response.Write("查看：<a href="""&parentrootpath&"/index_1.htm"&""" target=""_blank"">点击查看效果</a><br>")'打印保存路径
	end if
	set fs=nothing
	set TempArr=nothing
end sub 

'=================================================================================
'                             +-生成某个类的所有分页-+
'函数：CreateHtml_WithMultiCols(classid,pagesizes,cols)
'功能：生成某个类的所有分页
'参数：
'classid   		---栏目ID
'pagesizes 		---每页显示的记录个数
'cols			---设置每行显示列数
'=================================================================================
sub CreateHtml_WithMultiCols(classid,pagesizes,cols)
	dim currentpage,TempArr,Tempdir,ListName,totalnum,pagenum,TempContWrit,dirArr
	dim parentlist,parentrootpath,classdir,newsHref,queryStr,rowsnum,offsets,c_keywords,c_desc
	Set fs=Server.CreateObject("Scripting.FileSystemObject")	
	Set rs = Server.CreateObject("adodb.recordset")
	sql="select templet,title,savedir,keywords,description from catalogs where id="&classid
	rs.open sql,conn,3,1
	if not rs.eof then
		Tempdir=rs("templet")
		ListName=rs("title")
		parentrootpath=rs("savedir")
		c_keywords=rs("keywords")
		c_desc=rs("description")
	else
		response.Write("暂时没有数据!<input type='button' value='继续发布 →' onclick="&Chr(34)&"javascript:location.href='send.asp'"&Chr(34)&">")
		response.End()
	end if
	rs.close()
	set rs=nothing
	'读取信息
	queryStr="select"
	if(MaxSendPage<>0) then
		queryStr=queryStr&" top "&(MaxSendPage*pagesizes)
	end if
	queryStr=queryStr&" title,linkurl,id,moditime,title_color,isoutlink from news where checked=1 and classid="&classid&" order by id desc"
	Set rs = Server.CreateObject("adodb.recordset")
	rs.open queryStr,conn,3,1
	if not rs.eof and not rs.bof then
		TempArr=rs.GetRows()
		totalnum=ubound(TempArr,2)+1'新闻总数	
	else
		totalnum=0	
		'response.Write("暂时没有数据!<input type='button' value='继续发布 →' onclick="&Chr(34)&"javascript:location.href='send.asp'"&Chr(34)&">")
		'response.End()
	end if
	rs.close
	set rs=nothing
	
	pagenum=int((totalnum+pagesizes-1)/pagesizes)'获取总页数
	if(pagenum<1) then 
		pagenum=1
	end if
	if(MaxSendPage<>0 and pagenum>MaxSendPage) then
		pagenum=MaxSendPage
	end if
	response.write("总共"&totalnum&"条："&pagenum&"(页)"&"<br>")	
	'根据分类选择建立文件夹
	
	parentlist=Split(getparentlist(classid),"|")
	'response.Write(parentrootpath&"<br>")
	dirArr=split(parentrootpath,"/")
	for dirn=1 to ubound(dirArr)
		classdir=classdir&"/"&dirArr(dirn)
		call MakeDir(server.mappath(classdir))		
	next
	'读取模板内容
	If (fs.FileExists(server.mappath(Tempdir))) Then
		TempCont=ReadFromTextFile(server.mappath(Tempdir))
		'set file_r = fs.opentextfile(server.mappath(Tempdir),1,True)'读取模板文件
		'TempCont= file_r.ReadAll
		'file_r.close()
		'set file_r=nothing	
		'response.Write(TempCont)'打印模板内容
	else
		response.Write("没有找到模板文件："&server.mappath(Tempdir))
		response.End()
	end if
	if(TempCont<>"") then
		TempCont=replace(TempCont,"$keywords$",c_keywords)
		TempCont=replace(TempCont,"$description$",c_desc)
	else
		response.Write("错误，模板内容为空")
		response.End()

	end if
	'生成每页的HTML文件
	if totalnum<=0 then
		dim blankContent
		blankContent=TempCont
		'替换更新的内容						
		blankContent=replace(blankContent,"$NewsList$","暂时没有数据")		
		blankContent=ReplaceAllLabel(blankContent,classid)		
		blankContent=replace(blankContent,"$ShowPage$","")
		call SaveTextFile(server.mappath(parentrootpath)&"\index_1.htm",blankContent)
		'Set file_w = fs.CreateTextFile(server.mappath(parentrootpath)&"\index_1.htm",true)	
		'file_w.WriteLine(blankContent)
		'file_w.close
		'set file_w=nothing
		response.Write("文件成功保存至："&server.mappath(parentrootpath)&"\index_1.htm")
	else	
	for currentpage=1 to pagenum
		TempContWrit=TempCont
		goPage="&nbsp;&nbsp;跳至第<select size=1 onChange=""javascript:window.location.href='index_'+(G_page.selectedIndex+1)+'.htm'"" name=""G_page"">"
		for go_n=1 to pagenum
			if(go_n=currentpage) then
				goPage=goPage&"<option value="""&go_n&""" selected>"&go_n&"</option>"
			else
				goPage=goPage&"<option value="""&go_n&""">"&go_n&"</option>"
			end if
		next
		goPage=goPage&"</select>页&nbsp;&nbsp;"
		GetNewsList="<table width=""100%"">"&Chr(10)
		rowsnum=int((pagesizes-1+cols)/cols)
		for rows=0 to rowsnum-1
			if ((currentpage-1)*pagesizes+rows>=totalnum) then
		  			exit for
		 	end if
			GetNewsList=GetNewsList&"<tr>"&Chr(13)
			for coli=0 to cols-1
				offsets=(currentpage-1)*pagesizes+rows*cols+coli
				if (offsets>=totalnum) then
		  			exit for
		 		end if
				newsHref=TempArr(1,offsets)
				GetNewsList=GetNewsList&"<td width="""&int(100/cols)&"%"" height="&Chr(34)&"24"&Chr(34)&" bgcolor="&Chr(34)&"#FFFFFF"&Chr(34)&" style="&Chr(34)&"padding:2px 9px 2px 9px; "&Chr(34)&"><div align=left><a href="&Chr(34)&newsHref&Chr(34)&" target="&Chr(34)&"_blank"&Chr(34)
				if(TempArr(4,offsets)<>"") then
					GetNewsList=GetNewsList&" style=""color: "&TempArr(4,offsets)&""""
				end if
				GetNewsList=GetNewsList&"> · "&TempArr(0,offsets)&"</a></div></td>"&Chr(13)
     		next
			GetNewsList=GetNewsList&"</tr>"&Chr(13)			
		next	
		GetNewsList=GetNewsList&"</table>"&Chr(10)	
		'替换更新的内容						
		TempContWrit=replace(TempContWrit,"$NewsList$",GetNewsList)		
		TempContWrit=ReplaceAllLabel(TempContWrit,classid)
		if err.number>0 then
		response.Write(err.description)
		end if		
		TempContWrit=replace(TempContWrit,"$ShowPage$",""&showPage(currentpage,totalnum,pagenum)&goPage)
		
		'写入文件内容
		response.Write("文件成功保存到："&server.mappath(parentrootpath)&"\index_"&currentpage&".htm"&"<br>")'打印保存路径
		response.Write("OK")
		call SaveTextFile(server.mappath(parentrootpath)&"/index_"&currentpage&".htm",TempContWrit)
		'Set file_w = fs.CreateTextFile(server.mappath(parentrootpath)&"/index_"&currentpage&".htm",true)		
		'file_w.WriteLine(TempContWrit)
		'file_w.close
		'set file_w=nothing
	next	
	end if
	set fs=nothing
	set TempArr=nothing
end sub 
'if(datediff("d","2011-12-1",now())>0) then response.End() end if
'=================================================================================
'                             +-生成某个类的所有分页-+
'函数：CreateImgList(classid,pagesizes)
'功能：生成某个类的所有图片列表分页
'参数：
'classid   		---栏目ID
'pagesizes 		---每页显示的记录个数
'=================================================================================
sub CreateImgList(classid,pagesizes,rowsN,colsN,containW,containH)
	dim currentpage,TempArr,Tempdir,ListName,totalnum,pagenum,TempContWrit
	dim parentlist,parentrootpath,classdir,queryStr,c_keywords,c_desc
	Set fs=Server.CreateObject("Scripting.FileSystemObject")
	Set rs = Server.CreateObject("adodb.recordset")
	sql="select templet,title,savedir,keywords,description from catalogs where id="&classid
	rs.open sql,conn,3,1
	if not rs.eof then
		Tempdir=rs("templet")
		ListName=rs("title")
		parentrootpath=rs("savedir")
		c_keywords=rs("keywords")
		c_desc=rs("description")
	else
		response.Write("暂时没有数据!<input type='button' value='继续发布 →' onclick="&Chr(34)&"javascript:location.href='send.asp'"&Chr(34)&">")
		response.End()
	end if
	rs.close()
	set rs=nothing
	'读取信息
	queryStr="select"
	if(MaxSendPage<>0) then
		queryStr=queryStr&" top "&(MaxSendPage*pagesizes)
	end if
	queryStr=queryStr&" title,linkurl,id,photo from news where checked=1 and classid="&classid&" order by id desc"
	Set rs = Server.CreateObject("adodb.recordset")
	rs.open queryStr,conn,3,1
	if not rs.eof then
		TempArr=rs.GetRows()
	else
		response.Write("暂时没有数据!<input type='button' value='继续发布 →' onclick="&Chr(34)&"javascript:location.href='send.asp'"&Chr(34)&">")
		response.End()
	end if
	rs.close
	set rs=nothing
	totalnum=ubound(TempArr,2)+1'新闻总数	
	pagenum=int((totalnum+1+pagesizes-1)/pagesizes)'获取总页数
	if(pagenum<1) then 
		pagenum=1
	end if
	if(MaxSendPage<>0 and pagenum>MaxSendPage) then
		pagenum=MaxSendPage
	end if	
	response.write("总共"&totalnum&"条："&pagenum&"(页)"&"<br>")
	
	'根据分类选择建立文件夹
	
	parentlist=Split(getparentlist(classid),"|")
	'获得根节点的保存路径	
	response.Write(parentrootpath&"<br>")
	dirArr=split(parentrootpath,"/")
	for dirn=1 to ubound(dirArr)
		classdir=classdir&"/"&dirArr(dirn)
		call MakeDir(server.mappath(classdir))		
	next
	'读取模板内容
	If (fs.FileExists(server.mappath(Tempdir))) Then
		TempCont=ReadFromTextFile(server.mappath(Tempdir))
	else
		response.Write("没有找到模板文件："&server.mappath(Tempdir)&"")
		response.End()
	end if
	'set file_r = fs.opentextfile(server.mappath(Tempdir),1,True)'读取模板文件
	'TempCont= file_r.ReadAll
	'file_r.close()
	'set file_r=nothing	
	'response.Write(TempCont)'打印模板内容
	if(TempCont<>"") then
		TempCont=replace(TempCont,"$keywords$",c_keywords)
		TempCont=replace(TempCont,"$description$",c_desc)
	else
		response.Write("错误，模板内容为空")
		response.End()
	end if
	'生成每页的HTML文件
	if totalnum<0 then
		call SaveTextFile(server.mappath(parentrootpath)&classdir&"/index_"&currentpage&".htm","暂时没有数据，谢谢您的访问！<a href='"&SiteUrl&"'>返回首页</a>")
		'Set file_w = fs.CreateTextFile(server.mappath(parentrootpath)&classdir&"/index_"&currentpage&".htm",true)	
		'file_w.WriteLine("暂时没有数据，谢谢您的访问！<a href='"&SiteUrl&"'>返回首页</a>")
		'file_w.close
		'set file_w=nothing
	else	
	for currentpage=1 to pagenum
		TempContWrit=TempCont
		GetNewsList=""
		goPage="&nbsp;&nbsp;跳至第<select size=1 onChange=""javascript:window.location.href='index_'+(G_page.selectedIndex+1)+'.htm'"" name=""G_page"">"
		for go_n=1 to pagenum
			if(go_n=currentpage) then
				goPage=goPage&"<option value="""&go_n&""" selected>"&go_n&"</option>"
			else
				goPage=goPage&"<option value="""&go_n&""">"&go_n&"</option>"
			end if
		next
		goPage=goPage&"</select>页&nbsp;&nbsp;"
		'NewsArr=NewsArr&"<table width=500  border=0 align=center cellpadding=0 cellspacing=0>"&Chr(13)
		for rows=0 to rowsN-1'rowsN行	
			if ((currentpage-1)*pagesizes+rows*colsN>=totalnum) then
		  		exit for
		  	end if	
			GetNewsList=GetNewsList&"<div class=""photo_list""><ul>"&Chr(13)
			for cols=0 to colsN-1'colsN列
				if ((currentpage-1)*pagesizes+rows*colsN+cols>=totalnum) then
		  			exit for
		  		end if
				GetNewsList=GetNewsList&"<li>"&Chr(13)				
          		GetNewsList=GetNewsList&"<div class=""img_border""><div align=""center"">"&Chr(13)
				GetNewsList=GetNewsList&"<table bgcolor=""#ffffff"" width="""&containW&""" height="""&containH&"""  border=""0"" cellpadding=""0"" cellspacing=""0"">"&Chr(13)
				GetNewsList=GetNewsList&"	<tr>"&Chr(13)
				GetNewsList=GetNewsList&"		<td>"&Chr(13)
				GetNewsList=GetNewsList&"<div align=""center""><a href="&Chr(34)&TempArr(1,(currentpage-1)*pagesizes+rows*colsN+cols)&Chr(34)&" target="&Chr(34)&"_blank"&Chr(34)&"><img width="""&(containW-2)&""" height="""&(containH-2)&""" src="&Chr(34)&TempArr(3,(currentpage-1)*pagesizes+rows*colsN+cols)&Chr(34)&" alt="&Chr(34)&TempArr(0,(currentpage-1)*pagesizes+rows*colsN+cols)&Chr(34)&" align=""absmiddle"" border="&Chr(34)&"0"&Chr(34)&" /></a></div>"&Chr(13)
				GetNewsList=GetNewsList&"</td></tr></table></div></div>"&Chr(13)      			
        		GetNewsList=GetNewsList&"<div><a href="&Chr(34)&TempArr(1,(currentpage-1)*pagesizes+rows*colsN+cols)&Chr(34)&" target="&Chr(34)&"_blank"&Chr(34)&">"&left(TempArr(0,(currentpage-1)*pagesizes+rows*colsN+cols),(containW/12))&"</a></div>"&Chr(13)
				GetNewsList=GetNewsList&"</li>"&Chr(13)
     			if ((currentpage-1)*pagesizes+rows*colsN+cols>totalnum) then
		  			exit for
		  		end if						
			next			
			GetNewsList=GetNewsList&"</ul></div>"&Chr(13)				
			if ((currentpage-1)*pagesizes+rows*colsN+cols>totalnum) then
		  		exit for
		  	end if			
		next				
		'替换更新的内容								
		TempContWrit=replace(TempContWrit,"$NewsList$",GetNewsList)		
		TempContWrit=ReplaceAllLabel(TempContWrit,classid)
		if err.number>0 then
		response.Write(err.description)
		end if		
		TempContWrit=replace(TempContWrit,"$ShowPage$",""&showPage(currentpage,totalnum,pagenum)&goPage)
		
		'写入文件内容
		response.Write("文件成功保存到："&server.mappath(parentrootpath)&"\index_"&currentpage&".htm"&"<br>")'打印保存路径
		response.Write("OK")
		call SaveTextFile(server.mappath(parentrootpath)&"/index_"&currentpage&".htm",TempContWrit)
		'Set file_w = fs.CreateTextFile(server.mappath(parentrootpath)&"/index_"&currentpage&".htm",true)		
		'file_w.WriteLine(TempContWrit)
		'file_w.close
		'set file_w=nothing
	next	
	end if
	set fs=nothing
	set TempArr=nothing
end sub 
'=================================================================================
'                             +-生成某个栏目首页-+
'函数：CreateCatalogHtml(classid)
'功能：生成某个类的所有分页
'参数：
'classid   		---栏目ID
'=================================================================================
sub CreateCatalogHtml(classid)
	dim currentpage,TempArr,Tempdir,ListName,totalnum,pagenum,TempContWrit
	dim parentlist,parentrootpath,classdir,c_keywords,c_desc
	Set fs=Server.CreateObject("Scripting.FileSystemObject")
	Set rs = Server.CreateObject("adodb.recordset")
	sql="select templet,title,savedir,keywords,description from catalogs where id="&classid
	rs.open sql,conn,3,1
	if not rs.eof and not rs.bof then
		Tempdir=rs("templet")
		ListName=rs("title")
		parentrootpath=rs("savedir")
		c_keywords=rs("keywords")
		c_desc=rs("description")
	else		
		response.Write("暂时没有数据!<input type='button' value='继续发布 →' onclick="&Chr(34)&"javascript:location.href='send.asp'"&Chr(34)&">")
		response.End()
	end if
	rs.close()
	set rs=nothing
	
	
	'根据分类选择建立文件夹
	
	parentlist=Split(getparentlist(classid),"|")
	'获得根节点的保存路径
	
	'response.Write(parentrootpath)	
	dirArr=split(parentrootpath,"/")
	for dirn=1 to ubound(dirArr)
		classdir=classdir&"/"&dirArr(dirn)
		call MakeDir(server.mappath(classdir))		
	next
	'读取模板内容
	If (fs.FileExists(server.mappath(Tempdir))) Then
		TempCont=ReadFromTextFile(server.mappath(Tempdir))
		'set file_r = fs.opentextfile(server.mappath(Tempdir),1,True)		'读取模板文件
		'TempCont= file_r.ReadAll
		'file_r.close()
		'set file_r=nothing	
		'response.Write(TempCont)'打印模板内容
	else
		response.write("错误!没有找到模板文件:"&server.mappath(Tempdir))
		response.End()
	end if
	if(TempCont<>"") then
		TempCont=replace(TempCont,"$keywords$",c_keywords)
		TempCont=replace(TempCont,"$description$",c_desc)
	else
		response.Write("错误，模板内容为空")
		response.End()
	end if
	'生成每页的HTML文件
						
		'替换更新的内容						
		'TempCont=replace(TempCont,"$NewsList$",GetNewsList)		
		TempCont=ReplaceAllLabel(TempCont,classid)
		if err.number>0 then
		response.Write(err.description)
		end if		
		'写入文件内容
		response.Write("文件成功保存到："&server.mappath(parentrootpath)&"\index.htm"&"<br>")'打印保存路径
		if(parentrootpath="/") then
			response.Write("查看：<a href=""/index.htm"&""" target=""_blank"">点击查看效果</a><br>")
		else
			response.Write("查看：<a href="""&parentrootpath&"/index.htm"&""" target=""_blank"">点击查看效果</a><br>")
		end if
		response.Write("OK")
		call SaveTextFile(server.mappath(parentrootpath)&"/index.htm",TempCont)
		'Set file_w = fs.CreateTextFile(server.mappath(parentrootpath)&"/index.htm",true)		
		'file_w.WriteLine(TempCont)
		'file_w.close
		'set file_w=nothing

set fs=nothing
end sub
%>