找回密码
 加入
搜索
楼主: newuser

[系统综合] Afan老大,_WinHttpReadData的问题?

 火.. [复制链接]
 楼主| 发表于 2010-11-17 08:12:31 | 显示全部楼层
回复 13# republican
不行!
发表于 2010-11-17 10:32:59 | 显示全部楼层
回复 15# newuser
 楼主| 发表于 2010-11-17 10:54:24 | 显示全部楼层
回复 17# netegg
可怎么解决呢?
发表于 2010-11-17 11:46:20 | 显示全部楼层
回复 18# newuser
那个意思是说发送请求没成功呀,不是打开请求
发表于 2010-11-17 12:03:35 | 显示全部楼层
检查winhttp单独的代理服务器设置。(非IE)
 楼主| 发表于 2010-11-19 12:02:24 | 显示全部楼层
回复 20# republican

该如何检查呢?我用了如下代码:
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

#Include <WinHTTP.au3>

; 稍等
Global $sPACurl = _WinHttpDetectAutoProxyConfigUrl(BitOR($WINHTTP_AUTO_DETECT_TYPE_DHCP, $WINHTTP_AUTO_DETECT_TYPE_DNS_A))
MsgBox(64, "_WinHttpDetectAutoProxyConfigUrl", "The URL for the Proxy Auto-Configuration (PAC) file is: " & $sPACurl))
获得结果为空?
以下函数没有例子:
#Include <WinHTTP.au3>
_WinHttpSetDefaultProxyConfiguration( $iAccessType, $Proxy, $ProxyBypass )
我该如何设置我的机器的WinHTTP的单独代理呢?请帮助给个具体例子,谢谢.

这个我所获得信息,我不知道在注册表中怎么用?
    WINHTTP_PROXY_INFO proxyInfo;

    // Allocate memory for string members.
    proxyInfo.lpszProxy = new WCHAR[25];
    proxyInfo.lpszProxyBypass = new WCHAR[25];
    
    // Set the members of the proxy info structure.
    proxyInfo.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY;
    swprintf_s(proxyInfo.lpszProxy, 25, L"proxy_server");
    swprintf_s(proxyInfo.lpszProxyBypass, 25, L"<local>");

    // Set the default proxy configuration.
    if (WinHttpSetDefaultProxyConfiguration( &proxyInfo ))
        printf("Proxy Configuration Set.\n");

    // Free memory allocated to the strings.
    delete [] proxyInfo.lpszProxy;
    delete [] proxyInfo.lpszProxyBypass;
我的是局域网,OS  是WIN SERVER 2003 R2版.
发表于 2010-11-19 12:50:37 | 显示全部楼层
proxycfg.exe 看看。
 楼主| 发表于 2010-11-19 15:44:39 | 显示全部楼层
回复 22# republican

以下是信息:
当前 WinHTTP 代理设置在:
  HKEY_LOCAL_MACHINE\
    SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\
      WinHttpSettings :

     直接访问(无代理服务器)。

我该如何设置它呢?我纳闷我的注册表没有 Connections\ WinHttpSettings :  ?proxycfg.exe是怎么访问的呢?regedit和regedt32.exe 我都看了.
发表于 2010-11-21 22:01:29 | 显示全部楼层
来看看................
发表于 2010-11-22 07:59:48 | 显示全部楼层
我怎么没这个函数呢?
 楼主| 发表于 2010-11-22 14:39:14 | 显示全部楼层
回复 22# republican
哎,Dos的东西动生锈了,proxycfg -u,就可以将自己的局域网的代理服务器的设置岛入到注册表了,WinHttp的proxy也得到了设置,不在是"直接访问",可是郁闷的是:
$rContext=_WinHTTP_GetRespond($MyOpen,"http://www.google.com")
还是执行错误,得到的代码是:  code  0,
我比较坚持,也比较迟钝,还请多指教!
#include <Array.au3>
#Include <ACN_HASH.au3>
#include <WinHttp_GetRespond.au3>
_Example1()
Func _Example1()                                ;单独返回 Header
        $MyOpen=_WinHttpOpen()
        
        $rContext=_WinHTTP_GetRespond($MyOpen,"http://www.google.com")
        If @error Then MsgBox(48,"Error Code:",$rContext)
        _ArrayDisplay($rContext,"Example 1 Header为:")
 
        _WinHttpCloseHandle($MyOpen) 
EndFunc
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-16 02:22 , Processed in 0.068299 second(s), 14 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表