<!--#include file="CONN.asp"-->
<!--#include file="../sd_site.asp"-->
<!--#include file="cookies.asp"-->
<head>
<%Server.ScriptTimeOut=3600%>
<%
dim diy,qb,qto
if JT=0 then
response.Write "<script LANGUAGE='javascript'>alert('未打开生成HTM设置！');window.location='sd_htmnto.asp';</script>"
response.end
end if
qb="sd_"
qto="sd_show.asp"
Function GetPage(url) 
dim Retrieval
Set Retrieval = CreateObject("Microsoft.XMLHTTP") 
With Retrieval 
.Open "Get", url, False ', "", "" 
.Send 
GetPage = BytesToBstr(.ResponseBody)
End With 
Set Retrieval = Nothing 
End Function

Function BytesToBstr(body)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = "GB2312"
BytesToBstr = objstream.ReadText 
objstream.Close
set objstream = nothing
End Function
on error resume next
		row=0
		ID=Trim(Request.QueryString("id"))
		Do_Url   =   "http://" 
Url=Do_Url&Request.ServerVariables("SERVER_NAME")&"/"&qto&"?id="&id
wstr = GetPage(Url)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
If (fs.FileExists(server.MapPath("/")&"\"&qb&""&id&".htm")) Then
fs.DeleteFile(server.MapPath("/")&"\"&qb&""&id&".htm")
End If
Set CrFi=fs.CreateTextFile(server.MapPath("/")&"\"&qb&""&id&".htm")
Crfi.Writeline(wstr)
set CrFi=nothing
set fs=nothing

		zhais=GetZhais(rszhai("FromURL"))
		rszhai.movenext
		row=row+1
		rszhai.close
%>

<script type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>
<%
response.write "<script language=""javascript"">"
response.write "  alert(""成功生成1个最新HTML页面！"")"
response.write "</script>"
ComeUrl = Trim(Request("ComeUrl"))
If ComeUrl = "" Then
    ComeUrl = Request.ServerVariables("HTTP_REFERER")
End If
Response.Redirect ""&ComeUrl&""%>