注册 登录
编程论坛 ASP技术论坛

一个关于小偷程序的应用问题(具有一定深度哦!)

gupiao175 发布于 2008-02-22 17:36, 1745 次点击
代码如下:
<%'1、输入url目标网页地址,返回值getHTTPPage是目标网页的html代码
function getHTTPPage(url)
    dim Http
    set Http=server.createobject("Microsoft.XMLHTTP")
    Http.open "GET",url,false
    Http.send()
    if Http.readystate<>4 then
        exit function
    end if
    getHTTPPage=bytesToBSTR(Http.responseBody,"UTF-8/GB2312")
    set http=nothing
    if err.number<>0 then err.Clear
end function

'2、转换乱玛,直接用xmlhttp调用有中文字符的网页得到的将是乱玛,可以通过adodb.stream组件进行转换
Function BytesToBstr(body,Cset)
        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 = Cset
        BytesToBstr = objstream.ReadText
        objstream.Close
        set objstream = nothing
End Function
'Url="http://bill.finance.
Url="http://finance.
msg = getHTTPPage(Url)
response.write msg
%>
    问题描述:上代码中Url="http://finance.能显示出一些数据和页面,可是换成Url="http://bill.finance.确实一些乱码,请问如果我想把http://bill.finance.?stock_code=sh600900&bill_size=40000"这个页面的数据内容正确显示,我该如何改写代码,有人说是编码问题,可是无论UTF-8/GB2312都无法正常显示,希望有知道的帮个忙分析一下,非常感谢!
14 回复
#2
gupiao1752008-02-22 17:38
为防止沉海,自己继续顶个!
为防止沉海,自己继续顶个!
#3
gupiao1752008-02-26 16:53
哎,没人知道的吗?晕了!
哎,没人知道的吗?晕了!
#4
gupiao1752008-02-27 10:15
哎,俺的问题谁帮我看看啊!
哎,俺的问题谁帮我看看啊!能帮我搞定吗?谢了![bc02]
#5
gupiao1752008-02-27 16:57
真的没人能回答我的问题吗?
真的没人能回答我的问题啊!![bc02]
#6
gupiao1752008-02-28 16:30
不能下了,哎!
不能下了,哎![bc01]
#7
gupiao1752008-02-29 09:55
继续顶一下,我真怕沉没了!
继续顶一下,我真怕沉没了!


继续顶一下,我真怕沉没了!
#8
Kettyjin19832008-02-29 10:47
帮不了你,帮你顶下,等待高手出现.
#9
gupiao1752008-02-29 22:51
继续顶。哎,看来真的是没人会的了!
继续顶。哎,看来真的是没人会的了![bc02]
#10
gupiao1752008-03-06 17:16
顶一下,沉了好久了,哎!
顶一下,沉了好久了,哎![bc01]
#11
gupiao1752008-03-12 12:11
顶一下,沉了好久了,哎!继续顶!
顶一下,沉了好久了,哎!继续顶!
#12
com343142017-05-23 20:55
不能下了,哎!
#13
com343142017-05-23 20:55
不能下了,哎!
#14
com343142017-05-23 20:58
dim objstream
         set objstream = Server.CreateObject("adodb.stream")
         objstream.Type = 1
         objstream.Mode =3
         objstream.www.
         objstream.Write body
         objstream.Position = 0
         objstream.Type = 2
         objstream.Charset = Cset
         BytesToBstr = objstream.ReadText
         objstream.Close
         set objstream = nothing
 End Function
 'Url="http://bill.finance.
 Url="http://www.
 msg = getHTTPPage(Url)
 response.write msg
#15
com343142017-05-23 20:58
dim objstream
         set objstream = Server.CreateObject("adodb.stream")
         objstream.Type = 1
         objstream.Mode =3
         objstream.www.
         objstream.Write body
         objstream.Position = 0
         objstream.Type = 2
         objstream.Charset = Cset
         BytesToBstr = objstream.ReadText
         objstream.Close
         set objstream = nothing
 End Function
 'Url="http://bill.finance.
 Url="http://www.
 msg = getHTTPPage(Url)
 response.write msg
1