Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共10 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:关于MSXML2.XMLHTTP 。

1楼
dcse 发表于:2011/7/28 14:20:00

MSXML2.XMLHTTP  怎么POST数据。

 

 

CreateObject("MSXML2.XMLHTTP")

放到全局代码Public Function 中出错, XMLHTTP 的POST方法怎么用?

 

    http = CreateObject("MSXML2.XMLHTTP")
    http.Open("post", url, False)
    http.send(“这里加POST的数据无效”)

 

求解。

[此贴子已经被作者于2011-7-31 10:51:45编辑过]
2楼
狐狸爸爸 发表于:2011/7/28 14:29:00

http url这些变量应该定义吧?

这个类型我没有研究过。

3楼
dcse 发表于:2011/7/28 15:06:00

Public Function xmlhttp(ByVal uu As String , ByVal dd As String) As String
    Dim http As Object
    Dim html As String
    http = CreateObject("MSXML2.XMLHTTP")
    http.Open("post", uu, False)
    http.send(dd)
    html = http.responseText
    Return html
End Function

 

这样写对吗?

[此贴子已经被作者于2011-7-28 15:06:37编辑过]
4楼
狐狸爸爸 发表于:2011/7/28 15:25:00

这段代码的语法没有问题。

5楼
dcse 发表于:2011/7/28 15:35:00

---------------------------
错误
---------------------------
错误代码位置:窗口,窗口1,Button1,Click

 

System.ArgumentException: 参数不正确。

 

   在 Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)

   在 Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)

   在 UserCode.xmlhttp(String uu, String dd)

   在 UserCode.Click_24acabe3(ControlEventArgs e)
---------------------------
确定  
---------------------------

6楼
dcse 发表于:2011/7/28 16:05:00
等啊等~~
7楼
狐狸爸爸 发表于:2011/7/28 16:06:00

这不是语法问题的,这是你传递给xmlhttp的open方法的参数有问题

8楼
dcse 发表于:2011/7/28 16:46:00
终于发现,xmlhttp post 就会出现这个错误。怎么解决?
9楼
dcse 发表于:2011/7/29 8:48:00
xmlhttp post
10楼
dcse 发表于:2011/7/31 11:00:00
POST
共10 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02344 s, 2 queries.