<%
Function bytestobstr (body, cset)
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 = cset
Bytestobstr = objstream. readtext
Objstream. Close
Set objstream = nothing
End Function
Function gethttppage (URL)
Dim HTTP
Set HTTP = server. Createobject ("msxml2.xmlhttp ")
HTTP. Open "get", URL, false
HTTP. Send ()
If HTTP. readystate <> 4 then
Exit Function
End if
Gethttppage = bytestobstr (HTTP. responsebody, "gb2312 ")
Set HTTP = nothing
If err. Number <> 0 then err. Clear
End Function
'/////////////////////////////////////// /////
Sub refresh_news (ID)
Set rs = server. Createobject ("ADODB. recordset ")
SQL = "select * From conews where id =" & ID &""
Rs. Open SQL, Conn, 1, 1
If Rs. EOF then
Response. Write "<script language = JavaScript> alert ('parameter error! ');"
Response. Write "window. Close (); </SCRIPT>"
Response. End
Else
Weburl = "http: //" & request. servervariables ("http_host ")
File_name = RS ("ID ")
Frompage = weburl & "/news_info.asp? Id = "& ID &""
Filename = "../news_detail/" & file_name & ". html"
Stext = gethttppage (frompage)
Set fileobject = server. Createobject ("scripting. FileSystemObject ")
Set openfile = fileobject. opentextfile (server. mappath (filename), 2, true)
Openfile. writeline (stext)
Set openfile = nothing
End if
Rs. Close
Set rs = nothing
End sub
Sub refresh_product (ID)
Set rs = server. Createobject ("ADODB. recordset ")
SQL = "select * from product where id =" & ID &""
Rs. Open SQL, Conn, 1, 1
If Rs. EOF then
Response. Write "<script language = JavaScript> alert ('parameter error! ');"
Response. Write "window. Close (); </SCRIPT>"
Response. End
Else
Weburl = "http: //" & request. servervariables ("http_host ")
File_name = RS ("ID ")
Frompage = weburl & "/product_info.asp? Id = "& request (" ID ")&""
Filename = "../product/" & file_name & ". html"
Stext = gethttppage (frompage)
Set fileobject = server. Createobject ("scripting. FileSystemObject ")
Set openfile = fileobject. opentextfile (server. mappath (filename), 2, true)
Openfile. writeline (stext)
Frompage = weburl & "/en/product_info.asp? Id = "& request (" ID ")&""
Filename = "../en/product/" & file_name & ". html"
Stext = gethttppage (frompage)
Set fileobject = server. Createobject ("scripting. FileSystemObject ")
Set openfile = fileobject. opentextfile (server. mappath (filename), 2, true)
Openfile. writeline (stext)
Set openfile = nothing
Set openfile = nothing
End if
Rs. Close
Set rs = nothing
End sub
Sub refresh_productlist2 (SID)
Set rs = server. Createobject ("ADODB. recordset ")
SQL = "select * From mm_product_smallclass where id =" & SID &""
Rs. Open SQL, Conn, 1, 1
If Rs. EOF then
Response. Write "<script language = JavaScript> alert ('parameter error! ');"
Response. Write "window. Close (); </SCRIPT>"
Response. End
Else
Weburl = "http: //" & request. servervariables ("http_host ")
File_name = RS ("ID ")
Frompage = weburl & "/product/index. asp? SID = "& RS (" ID ")&""
Filename = "../product/list2 _" & RS ("ID") & ". html"
Stext = gethttppage (frompage)
Set fileobject = server. Createobject ("scripting. FileSystemObject ")
Set openfile = fileobject. opentextfile (server. mappath (filename), 2, true)
Openfile. writeline (stext)
Set openfile = nothing
End if
Rs. Close
Set rs = nothing
End sub
Sub refresh_case (ID)
Set rs = server. Createobject ("ADODB. recordset ")
SQL = "select * from project where id =" & ID &""
Rs. Open SQL, Conn, 1, 1
If Rs. EOF then
Response. Write "<script language = JavaScript> alert ('parameter error! ');"
Response. Write "window. Close (); </SCRIPT>"
Response. End
Else
Weburl = "http: //" & request. servervariables ("http_host ")
File_name = RS ("ID ")
Frompage = weburl & "/case_info.asp? Id = "& request (" ID ")&""
Filename = "../case/" & file_name & ". html"
Stext = gethttppage (frompage)
Set fileobject = server. Createobject ("scripting. FileSystemObject ")
Set openfile = fileobject. opentextfile (server. mappath (filename), 2, true)
Openfile. writeline (stext)
Set openfile = nothing
End if
Rs. Close
Set rs = nothing
End sub
%>