Convert the homepage to an asp file of the static html page

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.