473,804 Members | 3,497 Online
Bytes | Software Development & Data Engineering Community
+ 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\M icrosoft\Window s\CurrentVersio n\Internet
Settings\AutoCo nfigURL

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 2912
Anselme,

You can get the proxy information by making a call to
WinGetHttpProxy ForUrl. 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.co m

"Prehaut Anselme" <a.*******@stoc kadoo.net> wrote in message
news:eh******** ******@TK2MSFTN GP10.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\M icrosoft\Window s\CurrentVersio n\Internet
Settings\AutoCo nfigURL

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 "WinGetHttpProx yForUrl"

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

Thx for regards

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

You can get the proxy information by making a call to
WinGetHttpProxy ForUrl. 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.co m

"Prehaut Anselme" <a.*******@stoc kadoo.net> wrote in message
news:eh******** ******@TK2MSFTN GP10.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\M icrosoft\Window s\CurrentVersio n\Internet
Settings\AutoCo nfigURL

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(La youtKind.Sequen tial, CharSet=CharSet .Unicode)]
public struct WINHTTP_AUTOPRO XY_OPTIONS
{
[MarshalAs(Unman agedType.U4)]
public int dwFlags;
[MarshalAs(Unman agedType.U4)]
public int dwAutoDetectFla gs;
public stirng lpszAutoConfigU rl;
public IntPtr lpvReserved;
[MarshalAs(Unman agedType.U4)]
public int dwReserved;
public bool fAutoLoginIfCha llenged;
}

[StructLayout(La youtKind.Sequen tial, CharSet=CharSet .Unicode)]
public struct WINHTTP_PROXY_I NFO
{

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

[DllImport("winh ttp.dll", SetLastError=tr ue, CharSet=CharSet .Unicode)]
public static extern bool WinHttpGetProxy ForUrl(
IntPtr hSession,
string lpcwszUrl,
ref WINHTTP_AUTOPRO XY_OPTIONS pAutoProxyOptio ns,
ref WINHTTP_PROXY_I NFO pProxyInfo
);
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Prehaut Anselme" <a.*******@stoc kadoo.net> wrote in message
news:eT******** ******@TK2MSFTN GP10.phx.gbl...
Thanx, I've found the "WinGetHttpProx yForUrl"

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

Thx for regards

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

You can get the proxy information by making a call to
WinGetHttpProxy ForUrl. 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.co m

"Prehaut Anselme" <a.*******@stoc kadoo.net> wrote in message
news:eh******** ******@TK2MSFTN GP10.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\M icrosoft\Window s\CurrentVersio n\Internet
Settings\AutoCo nfigURL

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_AUTOPRO XY_CONFIG_URL
but how can I obtain this value ?

Thx a lot
Anselme

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

You will have to make the following declarations:

[StructLayout(La youtKind.Sequen tial, CharSet=CharSet .Unicode)]
public struct WINHTTP_AUTOPRO XY_OPTIONS
{
[MarshalAs(Unman agedType.U4)]
public int dwFlags;
[MarshalAs(Unman agedType.U4)]
public int dwAutoDetectFla gs;
public stirng lpszAutoConfigU rl;
public IntPtr lpvReserved;
[MarshalAs(Unman agedType.U4)]
public int dwReserved;
public bool fAutoLoginIfCha llenged;
}

[StructLayout(La youtKind.Sequen tial, CharSet=CharSet .Unicode)]
public struct WINHTTP_PROXY_I NFO
{

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

[DllImport("winh ttp.dll", SetLastError=tr ue, CharSet=CharSet .Unicode)]
public static extern bool WinHttpGetProxy ForUrl(
IntPtr hSession,
string lpcwszUrl,
ref WINHTTP_AUTOPRO XY_OPTIONS pAutoProxyOptio ns,
ref WINHTTP_PROXY_I NFO pProxyInfo
);
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Prehaut Anselme" <a.*******@stoc kadoo.net> wrote in message
news:eT******** ******@TK2MSFTN GP10.phx.gbl...
Thanx, I've found the "WinGetHttpProx yForUrl"

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

Thx for regards

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

You can get the proxy information by making a call to
WinGetHttpProxy ForUrl. 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.co m

"Prehaut Anselme" <a.*******@stoc kadoo.net> wrote in message
news:eh******** ******@TK2MSFTN GP10.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\M icrosoft\Window s\CurrentVersio n\Internet
> Settings\AutoCo nfigURL
>
> 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.co m

"Prehaut Anselme" <a.*******@stoc kadoo.net> wrote in message
news:Oq******** ******@TK2MSFTN GP10.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_AUTOPRO XY_CONFIG_URL
but how can I obtain this value ?

Thx a lot
Anselme

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

You will have to make the following declarations:

[StructLayout(La youtKind.Sequen tial, CharSet=CharSet .Unicode)]
public struct WINHTTP_AUTOPRO XY_OPTIONS
{
[MarshalAs(Unman agedType.U4)]
public int dwFlags;
[MarshalAs(Unman agedType.U4)]
public int dwAutoDetectFla gs;
public stirng lpszAutoConfigU rl;
public IntPtr lpvReserved;
[MarshalAs(Unman agedType.U4)]
public int dwReserved;
public bool fAutoLoginIfCha llenged;
}

[StructLayout(La youtKind.Sequen tial, CharSet=CharSet .Unicode)]
public struct WINHTTP_PROXY_I NFO
{

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

[DllImport("winh ttp.dll", SetLastError=tr ue, CharSet=CharSet .Unicode)]
public static extern bool WinHttpGetProxy ForUrl(
IntPtr hSession,
string lpcwszUrl,
ref WINHTTP_AUTOPRO XY_OPTIONS pAutoProxyOptio ns,
ref WINHTTP_PROXY_I NFO pProxyInfo
);
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Prehaut Anselme" <a.*******@stoc kadoo.net> wrote in message
news:eT******** ******@TK2MSFTN GP10.phx.gbl...
Thanx, I've found the "WinGetHttpProx yForUrl"

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

Thx for regards

Anselme
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> a écrit dans le message de news:O0******** ******@TK2MSFTN GP10.phx.gbl...
> Anselme,
>
> You can get the proxy information by making a call to
> WinGetHttpProxy ForUrl. 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.co m
>
> "Prehaut Anselme" <a.*******@stoc kadoo.net> wrote in message
> news:eh******** ******@TK2MSFTN GP10.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\M icrosoft\Window s\CurrentVersio n\Internet
> > Settings\AutoCo nfigURL
> >
> > 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.c om> a écrit
dans le message de news:eQ******** ******@tk2msftn gp13.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.co m

"Prehaut Anselme" <a.*******@stoc kadoo.net> wrote in message
news:Oq******** ******@TK2MSFTN GP10.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_AUTOPRO XY_CONFIG_URL
but how can I obtain this value ?

Thx a lot
Anselme

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

You will have to make the following declarations:

[StructLayout(La youtKind.Sequen tial, CharSet=CharSet .Unicode)]
public struct WINHTTP_AUTOPRO XY_OPTIONS
{
[MarshalAs(Unman agedType.U4)]
public int dwFlags;
[MarshalAs(Unman agedType.U4)]
public int dwAutoDetectFla gs;
public stirng lpszAutoConfigU rl;
public IntPtr lpvReserved;
[MarshalAs(Unman agedType.U4)]
public int dwReserved;
public bool fAutoLoginIfCha llenged;
}

[StructLayout(La youtKind.Sequen tial, CharSet=CharSet .Unicode)]
public struct WINHTTP_PROXY_I NFO
{

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

[DllImport("winh ttp.dll", SetLastError=tr ue, CharSet=CharSet .Unicode)]
public static extern bool WinHttpGetProxy ForUrl(
IntPtr hSession,
string lpcwszUrl,
ref WINHTTP_AUTOPRO XY_OPTIONS pAutoProxyOptio ns,
ref WINHTTP_PROXY_I NFO pProxyInfo
);
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

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

écrit
> dans le message de news:O0******** ******@TK2MSFTN GP10.phx.gbl...
> > Anselme,
> >
> > You can get the proxy information by making a call to
> > WinGetHttpProxy ForUrl. 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.co m
> >
> > "Prehaut Anselme" <a.*******@stoc kadoo.net> wrote in message
> > news:eh******** ******@TK2MSFTN GP10.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\M icrosoft\Window s\CurrentVersio n\Internet
> > > Settings\AutoCo nfigURL
> > >
> > > 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
3017
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 lately I've been wanting to do more stuff with user accounts, and had been eying MySQL for over a year. Finally I've decided to start off small by converting the forum's account system to a MySQL database (and convert the rest later after I'm...
2
3416
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 for a non-GUI way to just retrieve the web page. I know that there is, I just can't seem to find/remember what it is.
33
2374
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 implementation. The solution is in the tutorial for lcc-win32 (http://www.cs.virginia.edu/~lcc-win32) page 331.
3
1834
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 that
3
1152
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? Mark
2
1024
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)" and not the stored proc. Thanks Benoist
1
2473
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 for each web service method call. To get client information using integrated Windows authentication with ASP.NET client. You need to disable "Anonymous Access" and enable "Integrated Windows authentication". IE will automatically pass in the...
4
2359
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 the full URL I can provide. From postings here I thought mechanize held promise, but I've found it to contain filenames that are invalid for MSDOS (too many characters, and/or too many dots in the name, etc.) so I have little hope that the...
6
3473
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 an application pool that is does not have administrator privileges can't even enumerate the list of application pools. I can access the application pool by hard-coding the name, but even then the WAMUserPass is an empty property value...
5
9448
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
0
9704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9571
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10561
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10302
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9132
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5505
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.