1 2 下一页
如果我们开发的对象,不是在公网的环境内上网,是使用内网的,我们应该怎么样检测你的IE使用的代理服务器呢?接下来我们通过以下实例来学习:
//-----------------------------------------------
//记得引用 WinInet 单元
//-----------------------------------------------
uses
WinInet
//----------------------------------------------
//定义要使用的函数
//----------------------------------------------
function GetProxyInformation: string;
var
ProxyInfo: PInternetProxyInfo;
Len: LongWord;
begin
Result := '';
Len := 4096;
GetMem(ProxyInfo, Len);
try
if InternetQueryOption(nil, INTERNET_OPTION_PROXY, ProxyInfo, Len) then
if ProxyInfo^.dwAccessType = INTERNET_OPEN_TYPE_PROXY then
begin
Result := ProxyInfo^.lpszProxy
end;
finally
FreeMem(ProxyInfo);
end;
end;
procedure GetProxyServer(protocol: string; var ProxyServer: string;
var ProxyPort: Integer);
var
i: Integer;
proxyinfo, ps: string;
begin
ProxyServer := '';
ProxyPort := 0;
proxyinfo := GetProxyInformation;
if proxyinfo = '' then
Exit;
protocol := protocol '=';
上一篇: 用Delphi设计“抢三十”游戏
下一篇: Delphi学习:查句柄知多少
1 2 下一页
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




