<%
	Dim id

	if SaveFile("../html/train/"&Request.Cookies("admin_train_id")&"/index.html","http://www.ttxxnet.org/train/view_train.asp?id="&Request.Cookies("admin_train_id")&"") and SaveFile("../html/train/"&Request.Cookies("admin_train_id")&"/train_subject_list.html","http://www.ttxxnet.org/train/train_subject_list.asp?id="&Request.Cookies("admin_train_id")&"") and SaveFile("../html/train/"&Request.Cookies("admin_train_id")&"/train_tea.html","http://www.ttxxnet.org/train/train_tea.asp?id="&Request.Cookies("admin_train_id")&"") and SaveFile("../html/train/"&Request.Cookies("admin_train_id")&"/train_lx.html","http://www.ttxxnet.org/train/train_lx.asp?id="&Request.Cookies("admin_train_id")&"") then
	
		response.write"<SCRIPT language=JavaScript>alert('您的操作已完成,html生成成功,现在为您返回');"
		response.write"this.location.href='Admin_train.asp';</SCRIPT>"
		response.end
		
	else
	
		response.write"<SCRIPT language=JavaScript>alert('您的操作已完成,html生成失败,请与管理员联系,现在为您返回');"
		response.write"this.location.href='Admin_train.asp';</SCRIPT>"
		response.end
		
	end if
	
	function GetURL()
    dim url1,url2,url
    url1 = Request.ServerVariables("server_name")
	leng=len(Request.ServerVariables("path_info"))
	leng1=leng-19
    url2 = left(Request.ServerVariables("path_info"),leng1)
    url="http://"&url1&url2
    GetURL = url
	end function
	
	function SaveFile(LocalFileName,RemoteFileUrl)
	Dim Ads, Retrieval, GetRemoteData
	On Error Resume Next
	Set Retrieval = Server.CreateObject("Microso" & "ft.XM" & "LHTTP") '//把单词拆开防止杀毒软件误杀
	With Retrieval
	.Open "Get", RemoteFileUrl, False, "", ""
	.Send
	GetRemoteData = .ResponseBody
	End With
	Set Retrieval = Nothing
	Set Ads = Server.CreateObject("Ado" & "db.Str" & "eam") '//把单词拆开防止杀毒软件误杀
	With Ads
	.Type = 1
	.Open
	.Write GetRemoteData
	.SaveToFile Server.MapPath(LocalFileName), 2
	.Cancel()
	.Close()
	End With
	Set Ads=nothing
	if err <> 0 then
		SaveFile = false
		err.clear
	else
		SaveFile = true
	end if
	End function
%>