asp to html
<!--#include file="inc/conn.asp" -->
<%
openconn()
sql="select * from tbnews"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
id=rs("id")
%>
<%
do while not rs.eof
%>
<%
Do_Url = "http://"
'Do_Url = Do_Url&Request.ServerVariables("SERVER_NAME")&"/shownews.asp" Ö÷Ŀ¼
aa=Request.Servervariables("url") 'ÐéÄâĿ¼
bb=InstrRev(aa,"/")
cc=left(aa,bb)
Do_Url = Do_Url&Request.ServerVariables("HTTP_HOST")&cc&"shownews.asp"
id=rs("id")
call SaveFile(""&id&".html",do_url&"?id="&id&"")
rs("n_path")=id&".html"
rs.update
%>
<%rs.movenext
loop
%>
<%
Response.Write("------¹²Éú³ÉÁË"&rs.recordcount&"¸öÎļþ------")
response.Write filepath
%>
<%
function SaveFile(LocalFileName,RemoteFileUrl)
Dim Ads, Retrieval, GetRemoteData
On Error Resume Next
Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", RemoteFileUrl, False, "", ""
.Send
GetRemoteData = .ResponseBody
End With
Set Retrieval = Nothing
Set Ads = Server.CreateObject("Adodb.Stream")
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
closeconn
%>
Ïà¹ØÎĵµ£º
VISTA+IIS+ASP¼ÜÕ¾
1. VISTA裝IIS
1-1. ¿ØÖÆÃæ°åÖГ³ÌÐòºÍ¹¦ÄÜ”µÄλ ......
<head runat="server">
<title></title>
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
<script language="JavaScript"> ......
ÔÚaspÊý×鶨ÒåÖÐ,¿ÉÒÔÖ±½Ó¶¨Òå,Ò²¿ÉÒÔʹÓÃArrayº¯Êý¶¨Òå..
ÏÈ¿´ÓÃArray()º¯Êý¶¨ÒåÀý×Ó:
<%
dim MyArray
MyArray=Array("ÌìÑÄ·çÔÆ","СС³ÌÐòÔ±")
%>
<p><%=MyArray(1)%></p>
·µ»Ø½á¹û:СС³ÌÐòÔ±
Ö±½Ó¶¨Òå:
<%
dim MyArray(2)
MyArray(0)="ÌìÑÄ·çÔÆ"
MyArray(1)="СС³ ......
<script language="JavaScript">
function reloadcode(){
var verify=document.getElementById('safecode');
verify.setAttribute('src','images/chknumber.asp?'+Math.random());
//ÕâÀï±ØÐë¼ÓÈëËæ»úÊý²»È»µØÖ·ÏàͬÎÒ·¢ÖØÐ¼ÓÔØ
}
</script>
<img src="images/chknumber.asp"&n ......
<!--#include file="conn.asp" -->
<!--#include file="Fun.asp" -->
<%
'·¢ËÍÓʼþÀà
class SendEmails
'·¢ËÍ
private flag
private info
public sub Class_Initialize()
flag=false
info=""
end sub
public sub Class_Terminate()
flag=false
info=""
......