Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use Proxy in WebBrowser Control
Message
 
To
17/07/2011 12:18:52
General information
Forum:
Visual FoxPro
Category:
Internet applications
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01518399
Message ID:
01518458
Views:
57
Ideally you can have the global Proxy settings set up in IE's Internet Options. Typically these are global proxy settings for the machine that are either set up in IE or by administrators and apply to all applications that use Web access and use auto-proxy configuration (which IE does by default).

I would urge going down that path or if that doesn't work pop up the IE Network dialog and let the user configure the proxy settings there rather than managing it from your own code.

You can do:
lcCmd = "rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,4"
RUN &lcCmd
The last parameter is the page of the dialog - on Windows 7 it's page 4 that holds connection settings. I think it's page 3 on XP.

+++ Rick ---

>Hi All,
>
>I'm creating an application that uses web browser control and I need to add features for
>proxy support.
>
>I searched online and found an answer in C# that for the life of me I just can't convert to
>VFP code.
>
>The routine uses wininet.dll -
>
>It calls the InternetSetOption method but I just don't know how to put in the parameters.
>
>I was able to make the code run in C# but again it isn't working in VFP..
>
>Here's what I've been playing with in VFP
>
>cProxy = "128.119.41.211:3128"
>=InternetSetOption(0, 38, @cProxy, len(cProxy) )
>thisform.obrowser.navigate("http://www.whatismyip.com/")
>
>It's suppose to change the proxy before the browser navigates to what's my ip dot com and
>show proxy IP instead of the current IP.
>
>Help will be very much appreciated
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform