请教!!!!!!!!!!!!!1

解决方案 »

  1.   

    给你个 我写的  http://jinesc.6600.org/myweb/disp.asp?idd=1182&room=10  不过不快 也要分析 累呀, 比较不同的站点 里面的东西也 不同
      

  2.   

    请教:我按照楼上大侠猛提供的办法,试过xmlhttp,好像老是会出现乱码啊,怎么办啊!另外继续请教:那个办法更快,更可靠,更准确,更容易控制???那个webbrowser控件好像不是很好控制,另外也慢,当下载很多网页时,容易死机继续请教!谢谢先!
      

  3.   

    xmlhttp乱码是因为对方输出字符集的问题.你可以通过使用responseBody保存成到adodb.stream中的方法解决问题
      

  4.   

    谢谢 yonghengdizhen(等季节一过,繁花就凋落') 大侠的指点!请教:我不是很懂啊,能不能给一段代码我学习一下?谢谢先!
    再一次感谢!
      

  5.   

    Private Sub cmdTestURL_Click()
        Dim strResultFileName As String
        Dim strHomeUrl As String
        Dim strProtocol As String
        Dim strPath As String
        Dim strRootPath As String
        Dim oXmlDoc As New DOMDocument
        
        On Error Resume Next
        If InStr(txtRootURL.Text, "//") = 0 Then
            MsgBox "URL格式错误," & vbCrLf & "请使用[Protocol]://[Server DNS Name or IP Address]/[Path name]格式", vbCritical
            Exit Sub
        End If
        strProtocol = UCase(Split(txtRootURL.Text, "//")(0))
        If strProtocol <> "HTTP:" And strProtocol <> "HTTPS:" Then
            MsgBox "协议错误," & vbCrLf & "您只能使用HTTP或HTTPS进行数据上传", vbCritical
            Exit Sub
        End If
        strRootPath = txtRootURL.Text & "/default.asp"
        Dim oXmlHttp As New XMLHTTP
        Dim oErrorStream As New Stream
    '    frmLoginWeb.Show vbModal                              '测试用代码,用于非WebST登录
    '    oXmlHttp.Open "POST", strRootPath, False              '测试用代码,用于非WebST登录
    '    oXmlHttp.setRequestHeader "Content-Length", Len("user_name=" & frmLoginWeb.mstrUser & "&password=")   '测试用代码,用于非WebST登录
    '    oXmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"   '测试用代码
    '    oXmlHttp.send "user_name=" & frmLoginWeb.mstrUser & "&password="                                      '测试用代码,用于非WebST登录
        
        oXmlHttp.Open "GET", strRootPath, False
        'oXmlHttp.Open "GET", strRootPath, False, "dpcjyh", "dpcjyhfml777"
        oXmlHttp.send
        If Err.Number = 0 Then
            strResultFileName = App.Path & "\Error_" & Format(Now(), "YYYYMMDDHHMMSS") & ".htm"
            oErrorStream.Type = 1 '以二进制模式打开
            oErrorStream.Open
            oErrorStream.Write oXmlHttp.responseBody '将字符串内容写入缓冲
            oErrorStream.SaveToFile strResultFileName, 2 '-将缓冲的内容写入文件
            oErrorStream.Close  '关闭对象
            If oXmlHttp.Status <> 200 Then
                cmdTestURL.Enabled = True
                cmdTransmission.Enabled = False
                cmdGetProduct.Enabled = False
                MsgBox Err.Description, vbCritical
            Else
                oXmlHttp.Open "POST", txtRootURL.Text & "/store/sell/import_sale_info.asp", False
                oXmlHttp.send "<COMMAND NAME='QueryStatus'/>"
                If oXmlDoc.loadXML(oXmlHttp.responseXML.xml) Then
                    cmdTestURL.Enabled = False
                    txtRootURL.Enabled = False
                    cmdTransmission.Enabled = True
                    cmdGetProduct.Enabled = True
                    MsgBox "连接有效,您现在可以进行数据上传及下载!", vbInformation
                Else
                    MsgBox oXmlHttp.responseText
                    MsgBox "登录信息不正确!", vbInformation
                End If
            End If
        Else
            cmdTestURL.Enabled = True
            cmdTransmission.Enabled = False
            cmdGetProduct.Enabled = False
            MsgBox "连接无效,请检查Internet连接是否有效" & vbCrLf & "或是否有足够的权限访问远程URL", vbCritical
            txtUploadURL.SetFocus
        End If
        Err.Clear
        Set oXmlHttp = Nothing
    End Sub
      

  6.   

    这要看情况,根椐具体的网页来说,各不一样,
    一般说用inet,可很多网页,特别是CGI的网页INET会连不上,
    XML传输也很好,但遇上有JS脚本的网页就没法了,比如说,网页A,,上有一个JS脚本,,写入COOKIES,。再转到网页B,如果没有它写的COOKIES,你就进不了B,这种用客户端的脚本写入COOKIES,,XML就无法得到B的信息。
    还是用webbrowser吧,,安全,又可靠,就是费点时间,
    不过我想知道,webbrowser怎么返回源文件,我怎么没找到它的这个属性,请告诉我,
      

  7.   

    dom不是有一个document元素吗?
    用document.documentElement.outerHTML就能得到它的源文件内容了.