473,466 Members | 1,565 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can I retrieve a non-static proxy

Hi,

I have found the script of the .pac where to obtain the specification to
obtain a proxy when we use IE

This adress is in the
HKCU\Softawre\Microsoft\Windows\CurrentVersion\Int ernet
Settings\AutoConfigURL

I have the adress of a script,

How can I obtain trough which proxy I need to pass ???

Thx

Anselme
Nov 15 '05 #1
6 2897
Anselme,

You can get the proxy information by making a call to
WinGetHttpProxyForUrl. However, this shouldn't be needed, as the default
implementation of IWebProxy (returned through the static GetDefaultProxy on
the WebProxy class) should use the IE settings.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Prehaut Anselme" <a.*******@stockadoo.net> wrote in message
news:eh**************@TK2MSFTNGP10.phx.gbl...
Hi,

I have found the script of the .pac where to obtain the specification to
obtain a proxy when we use IE

This adress is in the
HKCU\Softawre\Microsoft\Windows\CurrentVersion\Int ernet
Settings\AutoConfigURL

I have the adress of a script,

How can I obtain trough which proxy I need to pass ???

Thx

Anselme

Nov 15 '05 #2
Thanx, I've found the "WinGetHttpProxyForUrl"

But how can I use it in my C# code ???

Thx for regards

Anselme
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit
dans le message de news:O0**************@TK2MSFTNGP10.phx.gbl...
Anselme,

You can get the proxy information by making a call to
WinGetHttpProxyForUrl. However, this shouldn't be needed, as the default
implementation of IWebProxy (returned through the static GetDefaultProxy on the WebProxy class) should use the IE settings.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Prehaut Anselme" <a.*******@stockadoo.net> wrote in message
news:eh**************@TK2MSFTNGP10.phx.gbl...
Hi,

I have found the script of the .pac where to obtain the specification to
obtain a proxy when we use IE

This adress is in the
HKCU\Softawre\Microsoft\Windows\CurrentVersion\Int ernet
Settings\AutoConfigURL

I have the adress of a script,

How can I obtain trough which proxy I need to pass ???

Thx

Anselme


Nov 15 '05 #3
Prehaut,

You will have to make the following declarations:

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct WINHTTP_AUTOPROXY_OPTIONS
{
[MarshalAs(UnmanagedType.U4)]
public int dwFlags;
[MarshalAs(UnmanagedType.U4)]
public int dwAutoDetectFlags;
public stirng lpszAutoConfigUrl;
public IntPtr lpvReserved;
[MarshalAs(UnmanagedType.U4)]
public int dwReserved;
public bool fAutoLoginIfChallenged;
}

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct WINHTTP_PROXY_INFO
{

[MarshalAs(UnmanagedType.U4)]
public int dwAccessType;
public string lpszProxy;
public string lpszProxyBypass;
}

[DllImport("winhttp.dll", SetLastError=true, CharSet=CharSet.Unicode)]
public static extern bool WinHttpGetProxyForUrl(
IntPtr hSession,
string lpcwszUrl,
ref WINHTTP_AUTOPROXY_OPTIONS pAutoProxyOptions,
ref WINHTTP_PROXY_INFO pProxyInfo
);
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Prehaut Anselme" <a.*******@stockadoo.net> wrote in message
news:eT**************@TK2MSFTNGP10.phx.gbl...
Thanx, I've found the "WinGetHttpProxyForUrl"

But how can I use it in my C# code ???

Thx for regards

Anselme
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit
dans le message de news:O0**************@TK2MSFTNGP10.phx.gbl...
Anselme,

You can get the proxy information by making a call to
WinGetHttpProxyForUrl. However, this shouldn't be needed, as the default implementation of IWebProxy (returned through the static GetDefaultProxy

on
the WebProxy class) should use the IE settings.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Prehaut Anselme" <a.*******@stockadoo.net> wrote in message
news:eh**************@TK2MSFTNGP10.phx.gbl...
Hi,

I have found the script of the .pac where to obtain the specification to obtain a proxy when we use IE

This adress is in the
HKCU\Softawre\Microsoft\Windows\CurrentVersion\Int ernet
Settings\AutoConfigURL

I have the adress of a script,

How can I obtain trough which proxy I need to pass ???

Thx

Anselme



Nov 15 '05 #4
Thx a lot, it's exactly what I need, but, there's a little thing more.

How can I acces to the dwflags enumeration ?

I need to set dwflags to
WINHTTP_AUTOPROXY_CONFIG_URL
but how can I obtain this value ?

Thx a lot
Anselme

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit
dans le message de news:OY**************@tk2msftngp13.phx.gbl...
Prehaut,

You will have to make the following declarations:

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct WINHTTP_AUTOPROXY_OPTIONS
{
[MarshalAs(UnmanagedType.U4)]
public int dwFlags;
[MarshalAs(UnmanagedType.U4)]
public int dwAutoDetectFlags;
public stirng lpszAutoConfigUrl;
public IntPtr lpvReserved;
[MarshalAs(UnmanagedType.U4)]
public int dwReserved;
public bool fAutoLoginIfChallenged;
}

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct WINHTTP_PROXY_INFO
{

[MarshalAs(UnmanagedType.U4)]
public int dwAccessType;
public string lpszProxy;
public string lpszProxyBypass;
}

[DllImport("winhttp.dll", SetLastError=true, CharSet=CharSet.Unicode)]
public static extern bool WinHttpGetProxyForUrl(
IntPtr hSession,
string lpcwszUrl,
ref WINHTTP_AUTOPROXY_OPTIONS pAutoProxyOptions,
ref WINHTTP_PROXY_INFO pProxyInfo
);
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Prehaut Anselme" <a.*******@stockadoo.net> wrote in message
news:eT**************@TK2MSFTNGP10.phx.gbl...
Thanx, I've found the "WinGetHttpProxyForUrl"

But how can I use it in my C# code ???

Thx for regards

Anselme
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit
dans le message de news:O0**************@TK2MSFTNGP10.phx.gbl...
Anselme,

You can get the proxy information by making a call to
WinGetHttpProxyForUrl. However, this shouldn't be needed, as the default implementation of IWebProxy (returned through the static
GetDefaultProxy on
the WebProxy class) should use the IE settings.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Prehaut Anselme" <a.*******@stockadoo.net> wrote in message
news:eh**************@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> I have found the script of the .pac where to obtain the
specification to > obtain a proxy when we use IE
>
> This adress is in the
> HKCU\Softawre\Microsoft\Windows\CurrentVersion\Int ernet
> Settings\AutoConfigURL
>
> I have the adress of a script,
>
> How can I obtain trough which proxy I need to pass ???
>
> Thx
>
> Anselme
>
>



Nov 15 '05 #5
Anselme,

It is probably declared in WinHttp.h, which would be included as part of
the platform SDK.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Prehaut Anselme" <a.*******@stockadoo.net> wrote in message
news:Oq**************@TK2MSFTNGP10.phx.gbl...
Thx a lot, it's exactly what I need, but, there's a little thing more.

How can I acces to the dwflags enumeration ?

I need to set dwflags to
WINHTTP_AUTOPROXY_CONFIG_URL
but how can I obtain this value ?

Thx a lot
Anselme

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit
dans le message de news:OY**************@tk2msftngp13.phx.gbl...
Prehaut,

You will have to make the following declarations:

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct WINHTTP_AUTOPROXY_OPTIONS
{
[MarshalAs(UnmanagedType.U4)]
public int dwFlags;
[MarshalAs(UnmanagedType.U4)]
public int dwAutoDetectFlags;
public stirng lpszAutoConfigUrl;
public IntPtr lpvReserved;
[MarshalAs(UnmanagedType.U4)]
public int dwReserved;
public bool fAutoLoginIfChallenged;
}

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct WINHTTP_PROXY_INFO
{

[MarshalAs(UnmanagedType.U4)]
public int dwAccessType;
public string lpszProxy;
public string lpszProxyBypass;
}

[DllImport("winhttp.dll", SetLastError=true, CharSet=CharSet.Unicode)]
public static extern bool WinHttpGetProxyForUrl(
IntPtr hSession,
string lpcwszUrl,
ref WINHTTP_AUTOPROXY_OPTIONS pAutoProxyOptions,
ref WINHTTP_PROXY_INFO pProxyInfo
);
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Prehaut Anselme" <a.*******@stockadoo.net> wrote in message
news:eT**************@TK2MSFTNGP10.phx.gbl...
Thanx, I've found the "WinGetHttpProxyForUrl"

But how can I use it in my C# code ???

Thx for regards

Anselme
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit dans le message de news:O0**************@TK2MSFTNGP10.phx.gbl...
> Anselme,
>
> You can get the proxy information by making a call to
> WinGetHttpProxyForUrl. However, this shouldn't be needed, as the

default
> implementation of IWebProxy (returned through the static GetDefaultProxy on
> the WebProxy class) should use the IE settings.
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mv*@spam.guard.caspershouse.com
>
> "Prehaut Anselme" <a.*******@stockadoo.net> wrote in message
> news:eh**************@TK2MSFTNGP10.phx.gbl...
> > Hi,
> >
> > I have found the script of the .pac where to obtain the

specification
to
> > obtain a proxy when we use IE
> >
> > This adress is in the
> > HKCU\Softawre\Microsoft\Windows\CurrentVersion\Int ernet
> > Settings\AutoConfigURL
> >
> > I have the adress of a script,
> >
> > How can I obtain trough which proxy I need to pass ???
> >
> > Thx
> >
> > Anselme
> >
> >
>
>



Nov 15 '05 #6
Thanks for all

I'll try alone yet

Anselme

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit
dans le message de news:eQ**************@tk2msftngp13.phx.gbl...
Anselme,

It is probably declared in WinHttp.h, which would be included as part of the platform SDK.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Prehaut Anselme" <a.*******@stockadoo.net> wrote in message
news:Oq**************@TK2MSFTNGP10.phx.gbl...
Thx a lot, it's exactly what I need, but, there's a little thing more.

How can I acces to the dwflags enumeration ?

I need to set dwflags to
WINHTTP_AUTOPROXY_CONFIG_URL
but how can I obtain this value ?

Thx a lot
Anselme

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a écrit dans le message de news:OY**************@tk2msftngp13.phx.gbl...
Prehaut,

You will have to make the following declarations:

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct WINHTTP_AUTOPROXY_OPTIONS
{
[MarshalAs(UnmanagedType.U4)]
public int dwFlags;
[MarshalAs(UnmanagedType.U4)]
public int dwAutoDetectFlags;
public stirng lpszAutoConfigUrl;
public IntPtr lpvReserved;
[MarshalAs(UnmanagedType.U4)]
public int dwReserved;
public bool fAutoLoginIfChallenged;
}

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
public struct WINHTTP_PROXY_INFO
{

[MarshalAs(UnmanagedType.U4)]
public int dwAccessType;
public string lpszProxy;
public string lpszProxyBypass;
}

[DllImport("winhttp.dll", SetLastError=true, CharSet=CharSet.Unicode)]
public static extern bool WinHttpGetProxyForUrl(
IntPtr hSession,
string lpcwszUrl,
ref WINHTTP_AUTOPROXY_OPTIONS pAutoProxyOptions,
ref WINHTTP_PROXY_INFO pProxyInfo
);
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Prehaut Anselme" <a.*******@stockadoo.net> wrote in message
news:eT**************@TK2MSFTNGP10.phx.gbl...
> Thanx, I've found the "WinGetHttpProxyForUrl"
>
> But how can I use it in my C# code ???
>
> Thx for regards
>
> Anselme
>
>
> "Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> a

écrit
> dans le message de news:O0**************@TK2MSFTNGP10.phx.gbl...
> > Anselme,
> >
> > You can get the proxy information by making a call to
> > WinGetHttpProxyForUrl. However, this shouldn't be needed, as the
default
> > implementation of IWebProxy (returned through the static

GetDefaultProxy
> on
> > the WebProxy class) should use the IE settings.
> >
> > Hope this helps.
> >
> >
> > --
> > - Nicholas Paldino [.NET/C# MVP]
> > - mv*@spam.guard.caspershouse.com
> >
> > "Prehaut Anselme" <a.*******@stockadoo.net> wrote in message
> > news:eh**************@TK2MSFTNGP10.phx.gbl...
> > > Hi,
> > >
> > > I have found the script of the .pac where to obtain the

specification
to
> > > obtain a proxy when we use IE
> > >
> > > This adress is in the
> > > HKCU\Softawre\Microsoft\Windows\CurrentVersion\Int ernet
> > > Settings\AutoConfigURL
> > >
> > > I have the adress of a script,
> > >
> > > How can I obtain trough which proxy I need to pass ???
> > >
> > > Thx
> > >
> > > Anselme
> > >
> > >
> >
> >
>
>



Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Daniel Tonks | last post by:
First, please excuse the fact that I'm a complete MySQL newbie. My site used forum software that I wrote myself (in Perl) which, up until now, has used flat files. This worked fine, however...
2
by: David Elliott | last post by:
I know I can use AxSHDocVw.AxWebBrowser browser.Navigate(...); catch the browser_DocumentComplete() and retrieve using the page using htm = (mshtml.HTMLDocument)browser.Document; I am looking...
33
by: jacob navia | last post by:
Recently there was a discussion in this group about how to retrieve the file name given a FILE *. The question raised my curiosity, and after some research I have come up with a good...
3
by: Richard Thornley | last post by:
Hello, I was just been given a project and I have some questions on how to accomplish the first part of the task. If a user sends an email to a specific email address I need to detect...
3
by: Mark Kloch | last post by:
Hello, I am sending (via email) a link to a page ( http://receive.aspx?ID=xxx) with the id from the database. How do I retrieve that data back from the database using that ID=xxx information? ...
2
by: Benoist LUGNIER | last post by:
Hello VB .NET - ADO .NET - SQL Server (MSDE) I want to retrieve the parameters of a stored procedure before execute it. I've already try the fillschema but it return the "return object (table)"...
1
by: John Yung | last post by:
Hi, I have a client (C# MS Excel Project) calling a Web Service to retrieve and update data. One of the business requirement is the client's NT Login ID, IP Address and computer name must be log...
4
by: John Savage | last post by:
I have a free web mail address and would like to use python to retrieve files that have been emailed to me. The basic code would accommodate cookies, a login name and password, then download using...
6
by: Dylan Nicholson | last post by:
Running as an administrator, I can retrieve the account password stored by IIS for any application pool (using the WAMUserPass property). But, unsurprisingly, an ASP.NET application running inside...
5
by: =?Utf-8?B?QXhlbCBEYWhtZW4=?= | last post by:
Hi, I've created a class library assembly containing several string resource files, like: - TableColumns.resx - TableColumns.de.resx - General.resx - General.de.resx
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.