<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Conn.asp" -->
<!--#include file="Config.asp" -->
<%
set rs1=server.CreateObject("Adodb.recordset")
rs1.open"select * From Article where ArtClass='企业新闻' order by artid desc",conn,1,1
do while not rs1.eof 

	set fso=CreateObject("Scripting.FileSystemObject") 
	set f=fso.OpenTextFile(server.mappath("/temp/"&rs1("HtmlFile")&"")) 
	StrContent=f.ReadAll 
	f.close 
	set f=nothing 
	set fso=nothing 
	StrContent=Replace(StrContent,"$$SiteKeyword$$",SiteKey)
	StrContent=Replace(StrContent,"$$SiteTitle$$",SiteTitle)
	StrContent=Replace(StrContent,"$$HtmlFile$$",Rs1("HtmlFile"))
	StrContent=Replace(StrContent,"$$SiteName$$",SiteName)
	StrContent=Replace(StrContent,"$$SiteUrl$$",SiteUrl)
	StrContent=Replace(StrContent,"$$ArtTitle$$",Rs1("ArtTitle"))
	
	StrContent=Replace(StrContent,"$$BusinessArt$$",Business())
	
	if IsNull(Rs1("ArtKeyWord"))=false then
	   StrContent=Replace(StrContent,"$$ArtKeyword$$",Rs1("ArtKeyWord"))
	end if
	if IsNull(Rs1("ArtDesc"))=false then
	   StrContent=Replace(StrContent,"$$ArtDesc$$",Rs1("ArtDesc"))
	end if
	StrContent=Replace(StrContent,"$$SiteUrl$$",SiteUrl)
	StrContent=Replace(StrContent,"$$CompanyNews(行业动态,8)$$",CompanyNews("行业动态",8))
	'StrContent=Replace(StrContent,"$$IndexTopAd()$$",IndexTopAd())
	StrContent=Replace(StrContent,"$$ArtContent$$",rs1("ArtContent"))
	StrContent=Replace(StrContent,"$$SiteBottom$$",SiteBottom)
	StrContent=Replace(StrContent,"$$Keyword$$",Keyword())
	
	set fso=CreateObject("Scripting.FileSystemObject") 
	set f=fso.CreateTextFile(server.mappath("/"&rs1("HtmlFile")&""), true ) 
	f.WriteLine(StrContent) 
	f.close 
	set f = nothing 
	set fso = nothing 

rs1.movenext
loop
rs1.close:set rs1=nothing
response.Write("<script language='javascript'>alert('网站企业新闻生成！');location.href='sysadmin_view.asp';</script>")
response.End()

%>
