This program can only convert the homepage to static! (For a page)
Upload the createhtml. asp file to the directory where your space is stored (index. asp ).
Enter the URL and open createhtml. asp.
If the conversion fails, you can change the name of createhtml. asp (for example, change to z. asp) and enter the URL to open z. asp.
This file can be renamed without affecting the operation.Copy codeThe Code is as follows: <%
If request. QueryString ("action") = "OK" then
Dim kk, url, http, reurl
Url = trim (request. Form ("url "))
If url = "" then
Url = "http://www.jb51.net"
End if
Kk = trim (request. Form ("ad "))
If kk = "" then
Kk = "index.html"
End if
Reurl = trim (request. Form ("reurl "))
Set http = Server. createobject ("Microsoft." & chr (120) & "MLHTTP ")
Http. open "GET", url, false
Http. send ()
Set objStream = Server. CreateObject ("ADODB. Stream ")
ObjStream. type = 1
ObjStream. open
Objstream. write http. responseBody
Objstream. saveToFile server. mappath (kk), 2
Response. write "<script language = 'javascript '>"
Response. write "alert ('published successfully ');"
Response. write "location. href = '" & reurl &"';"
Response. write "</script>"
Else
%>
<Style type = "text/css">
<! --
. STYLE1 {
Font-size: 12px;
Color: # FF0000;
}
. STYLE2 {
Color: # 0000FF;
Font-size: 12px;
}
-->
</Style>
<Form id = "form1" name = "form1" method = "post" action = "http: // <% = request. serverVariables ("HTTP_HOST") & request. serverVariables ("SCRIPT_NAME") %>? Action = OK ">
<Table> <tr> <td>
<Span class = "STYLE2"> URL to be converted to static: </span> </td> <input name = "url" type = "text" id = "url" value = "http://www.jb51.net"/>
<Span class = "STYLE1"> for example, http://www.jb51.net local file http: // localhost/</span> </td>
</Tr>
<Tr> <td> <span class = "STYLE2"> storage path: </span> </td> <td>
<Input name = "ad" type = "text" id = "ad" value = "index.htm"/>
<Span class = "STYLE1"> Save index.html as an index.html file in the same directory as this file </span> </td>
</Tr>
<Tr>
<Td> <span class = "STYLE2"> jump to static mode: </span> </td>
<Td>
<Input name = "reurl" type = "text" id = "reurl" value = "index.htm"/>
<Span class = "STYLE1"> after static conversion, a prompt box is displayed. After confirmation, the page is displayed. </span> </td>
</Tr>
<Tr> <td> <div align = "right">
</Div> </td> <input type = "submit" name = "Submit" value = "submit"/> </td>
</Tr> </table>
</Form>
<% End if %>
<Span class = "STYLE1"> This file can be renamed without affecting the operation </span>