vb6里面用XML的post不能发送成功的问题!

zgqtxwd 2008-05-13 02:17:04
代码函数:
Function SendTo(Url, Msg)
Dim XmlHttp As Object
Static loops As Integer
loops = loops + 1
If loops = 5 Then '进行五次的发送尝试
Exit Function
End If
On Error Resume Next
Set XmlHttp = CreateObject("Msxml2.XMLHTTP")
If Not IsObject(XmlHttp) Then
Set XmlHttp = CreateObject("Microsoft.XMLHTTP")
If Not IsObject(XmlHttp) Then Exit Function
End If
XmlHttp.Open "POST", Url, False
XmlHttp.setRequestHeader "CONTENT-TYPE", "application/x-www-form-urlencoded"
XmlHttp.setRequestHeader "Connection", " Keep-Alive"

'XmlHttp.Send URLEncoding(Msg)
XmlHttp.Send Msg
If XmlHttp.Status <> 200 Then
Set XmlHttp = Nothing
DoEvents
SendTo Url, Msg '没成功继续发送
Else
MsgBox XmlHttp.responseText
Set XmlHttp = Nothing
Exit Function
End If
End Function


调用内容
url=http://blog.tianya.cn/newblog/newblog/post_process.asp?idWriter=15984274&Key=759726267&BlogID=1639147
bb=SavePostMode=1&BlogTitle=%BD%F0%D3%A5%B2%A9%BF%CD&BlogName=zgqtxwd&bHidden=&title=jjjjjj&bcat=0&txtCategoryName=&ChannelCate=0&content=jjjjjjjjj&Body=&richtext=&searchKeyWords=jjjjj&searchKeyWords=&searchKeyWords=&searchKeyWords=&publish_date=2008-5-13&postshowsize=50&indent=1&commentOpen=1&weather=1&breast=2&trackbackURL=&GoodFriend=%D4%DA%B4%CB%CA%E4%C8%EB%BA%C3%D3%D1%D4%DA%CC%EC%D1%C4%C9%E7%C7%F8%B5%C4%D3%C3%BB%A7%C3%FB&bbs_item_name=%CC%EC%D1%C4%D4%D3%CC%B8&bbsType=1&bbs_item_id=free&Submit2=%D5%FD%CA%BD%B7%A2%B2%BC

SendTo(url, bb)' 用这个为什么不能正常发送啊?是不是上面这个url里面的参数太多啦?有什么办法可以解决吗?
...全文
190 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
silencenet 2008-05-13
  • 打赏
  • 举报
回复
还有。。


If XmlHttp.Status <> 200 Then
  Set XmlHttp = Nothing
  DoEvents
  SendTo Url, Msg '没成功继续发送

  '这里的Status<>200  并<>没有发送成功!
Else
  。。。。。。
End If

silencenet 2008-05-13
  • 打赏
  • 举报
回复
你用浏览器打开这个URL试试。。都没有这个网页。。返回的是404
http://blog.tianya.cn/newblog/newblog/post_process.asp?idWriter=15984274&Key=759726267&BlogID=1639147

567

社区成员

发帖
与我相关
我的任务
社区描述
英特尔® 边缘计算,聚焦于边缘计算、AI、IoT等领域,为开发者提供丰富的开发资源、创新技术、解决方案与行业活动。
社区管理员
  • 英特尔技术社区
  • shere_lin
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧