|
本帖最后由 jboy0813 于 2015-2-2 14:51 编辑
同样的代码,在win7上能正常使用,换到XP上后就不正常了呢?
经测试,问题原因是在XP上POST不上数据导致的,
想问下还有其它朋友遇到过这个问题吗?
我也注意到了POST要用大写.
- Set 访问 = CreateObject("WinHttp.WinHttpRequest.5.1")
- With 访问
- .Open "POST", URL, True
- .setRequestHeader "Referer", 主URL
- .send pst
-
- .WaitForResponse
- 'If .Status <> 200 Then MsgBox "连接出错"
- Mycookie = GetCookie(.GetAllResponseHeaders)
- Set xmldoc = CreateObject("msxml2.domdocument")
- xmldoc.async = False
- xmldoc.LoadXML (.responsetext)
- If xmldoc.getElementsByTagName("message")(0).Text <> "" Then
- '登陆失败
- 登陆窗口.用户信息_lab = xmldoc.getElementsByTagName("message")(0).Text
-
- 登陆窗口.Height = 148
- Set xmldoc = Nothing
- Set 访问 = Nothing
- Exit Function
- End If
复制代码
|
|