本帖最后由 bcrun 于 2013-04-04 19:07:06 编辑

解决方案 »

  1.   

    browser要等待网页加载完毕,还要考虑到框架及脚本,为什么不用xmlhttp模拟post包发送,下面是登陆代码,sendstr要通过抓包获得
    Dim xPost, sGet As Object
            Dim iRemote,  sendstr, tempAs String
            Dim k As Integer
            Set xPost = CreateObject("Microsoft.XMLHTTP")
           Set sGet = CreateObject("ADODB.Stream")
      iRemote = "http://10.67.132.33/"
      sendstr = "Username=" & name & "Password=" & mima
       xPost.Open "post", iRemote, False
        xPost.setRequestHeader "Accept", "image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/xaml+xml, application/x-ms-xbap, application/x-ms-application, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*"
            xPost.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
            xPost.setRequestHeader "Accept-Language", "zh-cn"
            xPost.setRequestHeader "Accept-Encoding", "gzip, deflate"
            xPost.setRequestHeader "Referer", "http://10.67.132.33/"
            xPost.send (sendstr)
           If xPost.readyState = 4 Then
             If xPost.Status = 200 Then
               sGet.mode = 3
            sGet.Type = 1
            sGet.Open
            sGet.Write (xPost.responseBody)
            sGet.Position = 0
            sGet.Type = 2
            sGet.charset = "gb2312" ' "gb2312"
            temp = sGet.ReadText '返回的网页
    end if
    end if