help on wininet (Internet Controls)

Alex Martelli alex at magenta.com
Fri Jul 21 16:18:57 EDT 2000


"Sebastian Ahrens" <sahrens at uv.ruhr-uni-bochum.de> wrote in message
news:39788FB9.F9F940E6 at uv.ruhr-uni-bochum.de...
> Hi,
> I am trying to find out how to use the Microsoft Internet Transfer
> Controls Com Object. Now I can´t figure out how to use the openURL
> method which reqires two Arguments (URL and DataType) On the one hand I
> don´t know who to specify the desired datatype (in VB it´s icByteArray
> or String)

According to the documentation of the OpenURL method on MSDN:

Settings

The settings for datatype are:

Constant     Value Description
icString     0     Default. Retrieves data as string.
icByteArray  1     Retrieves data as a byte array.

> and on the other I don´t know how to get the returned data.

It should just be the return value of the method, a string or
array as the case may be.


> The second question is whether anyone out there knows how to change the
> Proxy Setting in MSIE from python...

This is what MSDN has to say on the issue, after explaining
how to find out what your usual defaults for proxy are (i.e.,
Internet Options/Connection/Proxy Server):

If you intend to use a proxy other than that named in the dialog box, set
the AccessType property to icNamedProxy (2). Then set the Proxy property to
the name of the proxy, as shown in the code below:

Inet1.Proxy = "myProxyName"
Inet1.AccessType = icNamedProxy

On the other hand, if you are content to use the default proxy (as
determined by your computer's registry), ignore the Proxy property, and
simply set the AccessType to icUseDefault (0).

The settings for AccessType are shown in the following table:

Constant     Value           Description
icUseDefault 0 (Default)     Use Defaults. The control uses default settings
found in the
                             registry to access the Internet.
icDirect     1               Direct to Internet. The control has a direct
connection to
                             the Internet.
icNamedProxy 2               Named Proxy. Instructs the control to use the
proxy server
                             specified in the Proxy property.


MSDN mentions this in a Visual Basic context, but of course
it should all work just as well from Python.


As an aside: being an information junky, I just LOVE the MSDN.
Mostly for Windows stuff, OK, but I also find it useful as an
online searchable reference to HTML, the C++ standard library,
Unicode character tables, etc, etc.  Besides reading it at
msdn.microsoft.com, you can probably get slightly old extra
ones from Windows developer friends for free -- MS puts one
out 4 times a year, and you don't really need the latest one:-).


Alex






More information about the Python-list mailing list