怎么设置自定义COOKIE?
#include <IE.au3>#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Local $oIE = _IECreateEmbedded()
$Result = DllCall("Wininet.dll", "BOOL", "InternetSetCookie", "lpszUrl", 'passport.baidu.com/',"lpszCookieName", 'test',"lpszCookieData", 'test')
GUICreate("嵌入式 Web 控件测试", 640, 580, _
(@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$obj=GUICtrlCreateObj($oIE, 10, 40, 600, 360)
GUISetState()
_IENavigate($oIE, "http://hi.baidu.com/")
;$oIE.document.cookie='expires=Thu, 01-Jan-1970 00:00:01 GMT'
MsgBox(0, '', $oIE.document.cookie )
While 1
Sleep(10)
WEnd
= =#研究不来了!
http://msdn.microsoft.com/en-us/library/windows/desktop/aa385107(v=vs.85).aspx 给兄台相反,获取一个完整的COOKIE搞了一个通宵的时间,郁闷。。。总算达到最终的效果了。 $oIE.document.cookie='expires=Thu, 01-Jan-1970 00:00:01 GMT'
就是这句啊.
expires是超时时间.
如果你要用cookies保存username的话就是这样:
$oIE.document.cookie='username=drunk;expires=Thu, 01-Jan-2013 00:00:01 GMT'
页:
[1]