您的位置:程序门 -> web 开发 -> asp



xmlhttp 与serverxmlhttp的区别?


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


xmlhttp 与serverxmlhttp的区别?
发表于:2007-01-02 11:05:31 楼主
我做一个blog程序,想做一个trackback功能.但是有一个问题,我用xmlhttp   post信息出去的时候,是可以正确ping到其它的blog上面去,但是,我用serverxmlhttp方式的时候就不行,我看了一些别人的blog的代码就是用serverxmlhttp对像的.为什么我的不行呢?我是在本机上面试的,是不是serverxmlhttp只能运用在2000及以上系统呢?   先谢谢大家了!

代码:

function   trackback(remoteurl,myblogurl,myblogname,myblogtitle,myblogexcerpt)
dim   objxmlhttp,objxml,intstat,strmessage,strpostinfo
myblogurl   =   server.urlencode(myblogurl)
myblogname   =   server.urlencode(myblogname)
myblogtitle   =   server.urlencode(myblogtitle)
myblogexcerpt   =   server.urlencode(myblogexcerpt)

'构造要发送的请求内容
strpostinfo   =   "title= "   &   myblogtitle
strpostinfo   =   strpostinfo   &   "&url= "   &   myblogurl
strpostinfo   =   strpostinfo   &   "&excerpt= "   &   myblogexcerpt
strpostinfo   =   strpostinfo   &   "&blog_name= "   &   myblogname
'创建对象
set   objxmlhttp   =   server.createobject( "msxml2.serverxmlhttp ")
objxmlhttp.open   "post ",   remoteurl,   false
on   error   resume   next
objxmlhttp.send   strpostinfo
set   objxmlhttp   =   nothing
end   function
发表于:2007-01-02 11:08:141楼 得分:0
你在vb版发过一个类似的吧??

提示错误么?/
发表于:2007-01-02 11:25:242楼 得分:0
是啊,是在vb版里面发过,我是用vb6.0和asp都不行!没有提示错误,发送是成功的,但就是ping不到其它blog上面.但是用xmlhttp确可以,我想是不是因为我的电脑是xp系统的原因?
但是用serverxmlhttp拉数据还是可以的!
发表于:2007-01-02 14:18:343楼 得分:0
把on   error   resume   next去掉,有什么错误?
vb引用serverxmlhttp,需要得到微软的授权
发表于:2007-01-02 14:18:394楼 得分:0
mark
发表于:2007-01-02 14:18:465楼 得分:0
mark
发表于:2007-01-02 14:19:146楼 得分:0
把on   error   resume   next去掉,有什么错误?
vb引用serverxmlhttp,需要得到微软的授权
发表于:2007-01-02 14:19:177楼 得分:0
把on   error   resume   next去掉,有什么错误?
vb引用serverxmlhttp,需要得到微软的授权
发表于:2007-01-02 14:19:198楼 得分:0
把on   error   resume   next去掉,有什么错误?
vb引用serverxmlhttp,需要得到微软的授权
发表于:2007-01-02 15:16:029楼 得分:0
该回复于2007-12-28 16:38:59被管理员或版主删除
发表于:2007-01-03 12:38:3810楼 得分:0
不好意思,这二天有点事情,没有来得及看帖子.on   error   resume   next出掉之后也没有什么错误.到msdn上面去看了一下,可能的原因是serverxmlhttp服务器之后通信是要一种信认机制的,而我的个人电脑上没有配置代理,所以serverxmlhttp对像可以生成,不发生错误,但是服务器之间通信确存在问题,所以出现这种情况.如果这样就不方便了,所以没有选用它,而选用变通的方式.
发表于:2007-01-30 16:01:2611楼 得分:0
谢谢,我的问题解决了,看了你的代码


快速检索

最新资讯
热门点击