aspµ¥Ò³Éú³É¾²Ì¬Ò³
½ñÌìÔÚÍøÉÏÕÒÁ˺þùØÓÚASPÉú³É¾²Ì¬Ò³µÄ´úÂë ×î¶àµÄ¾ÍÊÇ FSO·½·¨£¬Ä£°å·½·¨£¬µ«²»ÖªµÀ£¬ÎÒ°Ñ´úÂëÄÃÀ´Ö®ºó¶¼²»ºÃÓ㬾ÍÊÇÌṩÏÂÔØµÄѹËõ°üÀïÃæÐ´ºÃµÄÎÒÔËÐж¼ÊÇÓдíÎ󡣡£
²»¹ý»ÆÌì²»¸ºÓÐÐÄÈË£¬ÎÒÖÕÓÚÕÒµ½Ò»¸öµ¥Ò³Éú³É¾²Ì¬µÄ·½·¨£¬ÄóöÀ´¸ø´ó¼Ò·ÖÏí
<!-- ======================== Éú³É¾²Ì¬·½·¨ ====================== -->
<%
Function GetPage(url)
'»ñµÃÎļþÄÚÈÝ
dim Retrieval
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False ', "", ""
.Send
GetPage = BytesToBstr(.ResponseBody)
End With
Set Retrieval = Nothing
End Function
Function BytesToBstr(body)
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 = "GB2312"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
on error resume next
Url=" http://www.ent-wangchong.cn/index.asp"'Òª¶ÁÈ¡µÄÒ³ÃæµØÖ·
response.write "¿ªÊ¼¸üÐÂÊ×Ò³..."
wstr = GetPage(Url)
'response.write(wstr)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
'if not MyFile.FolderExists(server.MapPath("/html/")) then
'MyFile.CreateFolder(server.MapPath("/html/"))'
'end if
'Òª´æ·ÅµÄÒ³ÃæµØÖ·
dizhi=server.MapPath("index.html")
If (fs.FileExists(dizhi)) Then
fs.DeleteFile(dizhi)
End If
Set CrFi=fs.CreateTextFile(dizhi)
Crfi.Writeline(wstr)
set CrFi=nothing
set fs=nothing
response.write "¸üÐÂÍê³É£¡"
response.End()
%>
±£´æÎªasp¾ÍÐУ¬ÐèÒªÉú³É£¬Ö´ÐÐÒ»ÏÂÕâ¸öÎļþ£¡
Ïà¹ØÎĵµ£º
ÏÈ¿´¿´ASP.NETÒ³ÃæË¢ÐµÄʵÏÖ·½·¨£º
µÚÒ»£º
private void Button1_Click( object sender, System.EventArgs e ) { Response.Redirect( Request.Url.ToString( ) ); } µÚ¶þ£º
private void Button2_Click( object sender, System.EventArgs e ) { Response.Write( " < script language=javascript>window.locatio ......
Ò»£¬¶¯Ì¬ÍøÒ³Óë¾²Ì¬ÍøÒ³
1£¬ÍøÒ³
ÍøÒ³ÊÇ·ûºÏHTML¹æ·¶£¬ÄÜͨ¹ýä¯ÀÀÆ÷¿´µ½µÄÎļþ¡£
2£¬¾²Ì¬ÍøÒ³
²ÉÓÃHTML±ê¼ÇÓïÑÔ±àдµÄÍøÒ³£¬ºó׺һ°ãΪ html »ò htm£¬Èç index.html¡£
3£¬¶¯Ì¬ÍøÒ³
²ÉÓÃASP£¬JSP£¬PHP£¬CGI µÈ³ÌÐò¶¯Ì¬Éú³ÉµÄÒ³Ãæ£¬Ö»ÓÐÔÚ½Óµ½Óû§·ÃÎÊÒªÇóºó²ÅÉú³ÉÒ³Ãæ²¢´«ÊäÖÁÓû§ä¯ÀÀÆ÷¡£ÎļþÃûºó׺Ϊ .asp £¬.shtm £ ......
³£ÓõĽű¾ÓïÑÔÓÐ Javascript ºÍ VBscript ¡£
ʹÓÃÄÄÖÖÓïÑÔÐèÏÈÉ趨¡£ÈçÉϽڴúÂëÖеÄ<%@ LANGUAGE="JSCRIPT" ... %>¡£
Èç¹ûûÓÐÖ¸¶¨£¬ÏµÍ³¾Í»áʹÓà IIS ³ÌÐòÖ¸¶¨µÄ½Å±¾ÓïÑÔ¡£
VBscript Ó÷¨
VBscript Ò»°ã·ÅÔÚ <head> Óë </head> ÄÚµÄ <% ºÍ %> Ö®¼ä¡£
´ú ......
FormatDateTime
·µ»Ø±í´ïʽ£¬´Ë±í´ïʽÒѱ»¸ñʽ»¯ÎªÈÕÆÚ»òʱ¼ä¡£
FormatDateTime(Date[, NamedFormat])
²ÎÊý
Date
±ØÑ¡Ïî¡£Òª±»¸ñʽ»¯µÄÈÕÆÚ±í´ïʽ¡£
NamedFormat
¿ÉÑ¡ÏָʾËùʹÓõÄÈÕÆÚ/ʱ¼ä¸ñʽµÄÊýÖµ£¬Èç¹ûÊ¡ÂÔ£¬ÔòʹÓà vbGeneralDate¡£
ÉèÖÃ
NamedFormat ²ÎÊý¿ÉÒÔÓÐÒÔÏÂÖµ£º
³£Êý Öµ ÃèÊö
vbGeneralDate ......