²É¼¯³ÌÐò¡¾ASP¡¿
²É¼¯³ÌÐò
ÔÀí
²É¼¯³ÌÐòʵ¼ÊÉÏÊÇͨ¹ýÁËXMLÖеÄXMLHTTP×é¼þµ÷ÓÃÆäËüÍøÕ¾ÉϵÄÍøÒ³¡£±ÈÈçÐÂÎŲɼ¯³ÌÐò£¬ºÜ¶à¶¼Êǵ÷ÓÃÁËsinaµÄÐÂÎÅÍøÒ³£¬²¢ÇÒ¶ÔÆäÖеÄhtml½øÐÐÁËһЩÌæ»»£¬Í¬Ê±¶Ô¹ã¸æÒ²½øÐÐÁ˹ýÂË¡£Óòɼ¯³ÌÐòµÄÓŵãÓУºÎÞÐëά»¤ÍøÕ¾£¬ÒòΪ²É¼¯³ÌÐòÖеÄÊý¾ÝÀ´×ÔÆäËûÍøÕ¾£¬Ëü½«ËæןÃÍøÕ¾µÄ¸üжø¸üУ»¿ÉÒÔ½ÚÊ¡·þÎñÆ÷×ÊÔ´£¬Ò»°ã²É¼¯³ÌÐò¾Í¼¸¸öÎļþ£¬ËùÓÐÍøÒ³ÄÚÈݶ¼ÊÇÀ´×ÔÆäËûÍøÕ¾¡£È±µãÓУº²»Îȶ¨£¬Èç¹ûÄ¿±êÍøÕ¾³ö´í£¬³ÌÐòÒ²»á³ö´í£¬¶øÇÒ£¬Èç¹ûÄ¿±êÍøÕ¾½øÐÐÉý¼¶Î¬»¤£¬ÄÇô²É¼¯³ÌÐòÒ²Òª½øÐÐÏàÓ¦Ð޸ģ»Ëٶȣ¬ÒòΪÊÇÔ¶³Ìµ÷Óã¬ËٶȺÍÔÚ±¾µØ·þÎñÆ÷É϶ÁÈ¡Êý¾Ý±ÈÆðÀ´£¬¿Ï¶¨ÒªÂýһЩ¡£
Ò»¡¢ÊÂÀý
ÏÂÃæ¾ÍXMLHTTPÔÚASPÖеÄÓ¦ÓÃ×ö¸ö¼òµ¥ËµÃ÷
<%
’³£Óú¯Êý
’1¡¢ÊäÈëurlÄ¿±êÍøÒ³µØÖ·£¬·µ»ØÖµgetHTTPPageÊÇÄ¿±êÍøÒ³µÄhtml´úÂë
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
'2¡¢×ª»»ÂÒÂֱ꣬½ÓÓÃxmlhttpµ÷ÓÃÓÐÖÐÎÄ×Ö·ûµÄÍøÒ³µÃµ½µÄ½«ÊÇÂÒÂ꣬¿ÉÒÔͨ¹ýadodb.stream×é¼þ½øÐÐת»»
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" ’ת»»ÔÀ´Ä¬ÈϵÄUTF-8±àÂëת»»³ÉGB2312±àÂ룬·ñÔòÖ±½ÓÓÃXMLHTTP×é¼þµ÷ÓÃÓÐÖÐÎÄ×Ö·ûµÄÍøÒ³µÃµ½µÄ½«ÊÇÂÒÂë
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
’ÏÂÃæÊÔ×ŵ÷ÓÃhttp://www.googleµÄhtmlÄÚÈÝ
Dim Url,Html
Url="http://ww
Ïà¹ØÎĵµ£º
<%
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from 0791idc_News where BigClassName='¼Ò×°¿ÎÌÃ' order by ID desc"
rs.Open sql,Conn,1,1
if rs.eof and rs.bof then
response.Write("ÔÝʱûÓмǼ")
else
%>
......
+++ ASP.NET»º´æÖеÄÊý¾ÝÊDz»Îȶ¨µÄ£¬²»»á±»ÓÀ¾ÃµØ´æ´¢£¬¿ÉÄÜ»áÓÉÓÚÒÔÏÂÔÒòÖ®Ò»¶ø´Ó»º´æÖб»×Ô¶¯ÒƳý£º
1) »º´æÂúÁË
2) »º´æÏîÒѾ¹ýÆÚ
3) »º´æÒÀÀµµÄÏî¸Ä±äÁË
+++ ³ýÁË¿ÉÒÔ×Ô¶¯ÒƳý»º´æÏîÍ⣬Äã¿ÉÒÔÏÔʾÒƳý»º´æÏî¡£ÁíÍ⣬µ±ÄãÓÃInsert·½·¨ºÍAdd·½·¨Ïò»º´æÖÐÌí¼ÓµÄ»º´æÏîÒѾ´æÔÚʱ£¬ÄÇô£¬ÔÀ´µÄ»º´æÏ±»×Ô¶¯É¾³ý¡ ......
´úÂ룺
<%@ LANGUAGE=VBScript CodePage=65001%>
<%
private function decodeBase64(base64)
dim DM, EL
Set DM = CreateObject("Microsoft.XMLDOM")
Set EL = DM.createElement("tmp")
EL.DataType = "bin.base64"
& ......
±¾ÌùÀ´×ÔZDNetChinaÖÐÎÄÉçÇø http://bbs.zdnet.com.cn/
±¾ÌùµØÖ·£ºhttp://bbs.zdnet.com.cn/viewthread.php?tid=108315
Èç¹ûÄãÒѾÓн϶àµÄÃæÏò¶ÔÏ󿪷¢¾Ñ飬Ìø¹ýÒÔÏÂÕâÁ½²½£º
¡¡¡¡µÚÒ»²½¡¡ÕÆÎÕÒ»ÃÅ.NETÃæÏò¶ÔÏóÓïÑÔ£¬C#»òVB.NET ÎÒÇ¿ÁÒ·´¶ÔÔÚûϵͳѧ¹ýÒ»ÃÅÃæÏò¶ÔÏó(OO)ÓïÑÔµÄÇ°ÌáÏÂȥѧASP.NET¡£ ASP.NETÊÇ ......