I would like to set the proxy configuration with WinInet.
Therefore i need to define a variable of the type
'INTERNET_PER_CONN_OPTION_LIST' and one of the type
'INTERNET_PER_CONN_OPTION' according to the documentation i found on 'About
Delphi Programming'.
Unfortunately Delphi 5 does not know these types.
Other constants like 'INTERNET_OPTION_PROXY_USERNAME' pose no problem.
Can somebody help me?
Thanks in advance.
--
Vriendelijke groeten,
Dany Rosseel
E-mail: dany.r...@advalvas.be
Web Site : http://users.skynet.be/bk296578/Dro/
I did find the answer myself, the 'IntenetOpen' functions provides the
possibility to define the usage of a proxy:
s1 := 'http://'+ proxyinfo.proxy_address + ':' + proxyinfo.proxy_port;
s2 := '<local>';
hSession := InternetOpen( PChar(sAppName),
INTERNET_OPEN_TYPE_PROXY,
PChar(String(s1)), PChar(String(s2)), 0);
In the case you do not want to use a proxy then this will do:
hSession := InternetOpen( PChar(sAppName),
INTERNET_OPEN_TYPE_PRECONFIG,
nil, nil, 0);
In both cases above it is possible to set the name and the password for
proxy authorization:
InternetSetOption( hSession, INTERNET_OPTION_PROXY_USERNAME,
PChar(String(proxyinfo.user_name)),
length(proxyinfo.user_name) + 1);
InternetSetOption( hSession, INTERNET_OPTION_PROXY_PASSWORD,
PChar(String(proxyinfo.password)),
length(proxyinfo.password) + 1);
'proxyinfo' is a record that looks like this:
type
TProxyInfo = record
use_proxy : boolean;
proxy_address : shortstring;
proxy_port : shortstring;
use_proxy_authorization : boolean;
user_name : shortstring;
password : shortstring;
end;
--
Vriendelijke groeten,
Dany Rosseel
E-mail: dany.r...@advalvas.be
Web Site : http://users.skynet.be/bk296578/Dro/
"Rosseel Dany" <dany.r...@advalvas.be> schreef in bericht
news:3c559eaf$0$75153$ba62...@news.skynet.be...