请教IE对象的navigate在post data的用法!!!
我的示例代码:$include <IE.au3>
$oIE=_IECreate("about:blank")
$header="Content-Type: application/x-www-form-urlencoded" & @CRLF
$postdata="abc=123&de=45"
$packingArray=PackingPostData($postdata)
$oIE.Navigate("http://somewhere.com/post", 0, "", $packingArray, $header)
Func PackingPostData($postcontent)
$count=StringLen($postcontent)
Local $pack[$count]
For $i=1 To $count
$ch=StringMid($postcontent, $i, 1)
If $ch=" " Then $ch="+"
$pack[$i-1]=Asc($ch)
Next
Return $pack
EndFunc
跟踪结果发现Post部分全是乱码,如下:
wwww杦wfwwwwwwwwwww杦wbwwwwwwwwwww杦wfwwwwwww
请教高人指点,$packingArray该如何写,谢谢!!! StringToASCIIArray()是不是 PackingPostData()要的效果
#include <Array.au3> ; For _ArrayDisplay()
Local $s = "abc数组ABC"
Local $a = StringToASCIIArray($s, 0, StringLen($s), 2)
_ArrayDisplay($a)
$header="Content-Type: application/x-www-form-urlencoded" & @CRLF
$postdata="abc=123&de=45" & @CRLF
$packingArray=StringToASCIIArray($postdata, 0, StringLen($postdata), 2)
查询了半天,$packingArray要求为safearray结构。
没有找到可以设置safearray的API函数!
页:
[1]