Using Win32 functions in Visual FoxPro Image Gallery
Internet Functions (WinInet)
..msdn
CreateMD5SSOHash
DeleteUrlCacheEntry
DetectAutoProxyUrl
FindCloseUrlCache
FindFirstUrlCacheEntry
FindFirstUrlCacheGroup
FindNextUrlCacheEntry
FindNextUrlCacheGroup
FtpCommand
FtpCreateDirectory
FtpDeleteFile
FtpFindFirstFile
FtpGetCurrentDirectory
FtpGetFile
FtpGetFileSize
FtpOpenFile
FtpPutFile
FtpRemoveDirectory
FtpRenameFile
FtpSetCurrentDirectory
GetUrlCacheEntryInfo
HttpOpenRequest
HttpQueryInfo
HttpSendRequest
InternetAttemptConnect
InternetAutodial
InternetAutodialHangup
InternetCanonicalizeUrl
InternetCheckConnection
InternetCloseHandle
InternetConnect
InternetCrackUrl
InternetDial
InternetFindNextFile
InternetGetConnectedState
InternetGetConnectedStateEx
InternetGetCookie
InternetGetLastResponseInfo
InternetGoOnline
InternetOpen
InternetOpenUrl
InternetQueryDataAvailable
InternetQueryOption
InternetReadFile
InternetSetCookie
InternetSetFilePointer
InternetTimeFromSystemTime
InternetTimeToSystemTime
InternetWriteFile
Code examples:
The DetectAutoProxyUrl function identifies the auto-config script location
The DetectAutoProxyUrl function identifies the auto-config script location

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Before you begin:
Citing from the WLUG Wiki:
   Internet Explorer has an [x] Automatically detect settings check box. This will cause the browser to search for the configuration file.

If your DomainName is machine.something.meta.net.nz then InternetExplorer will request the following urls until it finds a WPAD configuration file.

http://wpad.something.meta.net.nz/wpad.dat
http://wpad.meta.net.nz/wpad.dat
http://wpad.net.nz/wpad.dat
http://wpad.nz/wpad.dat


WPAD stands for Web Proxy Auto-Discovery.

 
DO decl
 
LOCAL lcRmScript, lcLocal
lcRmScript = Repli(Chr(0), 250)
 
* dwDetectFlags = 1, 2
* PROXY_AUTO_DETECT_TYPE_DHCP
* PROXY_AUTO_DETECT_TYPE_DNS_A
IF DetectAutoProxyUrl(@lcRmScript, Len(lcRmScript), 2) = 0
    WAIT WINDOW NOWAIT "Not detected. "
    RETURN
ENDIF
 
lcRmScript = STRTRAN(lcRmScript, Chr(0), "")
 
IF Not EMPTY(lcRmScript)
    = MessageB("Location of a WPAD autoproxy script:     " +;
        Chr(13)+Chr(13) + lcRmScript, 64, " DetectAutoProxyUrl")
 
    WAIT WINDOW NOWAIT "Donwloading from URL... "
    lcLocal = SYS(2003) + "\autoscript.txt"
    URLDownloadToFile(0, lcRmScript, lcLocal, 0,0)
    WAIT WINDOW NOWAIT "Downloaded from " + lcRmScript + "   "
 
    IF FILE(lcLocal)
        MODI FILE (lcLocal) NOMODI NOWAIT
    ENDIF
ENDIF
* end of main
 
PROCEDURE decl
    DECLARE INTEGER GetLastError IN kernel32
 
    DECLARE INTEGER DetectAutoProxyUrl IN wininet;
        STRING @lpszAutoProxyUrl, LONG dwAutoProxyUrlLength,;
        LONG dwDetectFlags
 
    DECLARE INTEGER URLDownloadToFile IN urlmon;
        INTEGER pCaller, STRING szURL, STRING szFileName,;
        INTEGER dwReserved, INTEGER lpfnCB
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1094 bytes  
Created: 2002-11-13 14:03:10  
Modified: 2009-01-03 15:26:33  
Visits in 7 days: 76  
Listed functions:
DetectAutoProxyUrl
GetLastError
URLDownloadToFile
Printer friendly API declarations
My comment:
An example of WPAD.DAT file:

function FindProxyForURL(url, host)
{
        // We only cache http and ftp
        if (url.substring(0, 5) == "http:" || url.substring(0, 4) == "ftp:")
                return "PROXY cache:8080; DIRECT";

        // Otherwise use direct connection
        return "DIRECT";
}


#kwd: sln_http.
Word Index links for this example:
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.


Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (50.16.132.180)
27.4 min.Function: 'SetFocus'
Function group: 'Keyboard Input'
27.43 min.Example: 'How to create transparent areas inside a form -- punching holes in the form'
2.6 hrs.Example: 'Setting the last-error code for the FoxPro'
 Function: 'CreateSymbolicLink'
2.7 hrs.Example: 'Creating a console window for Visual FoxPro application'
 Example: 'Converting a hexadecimal string to an integer'
 Example: 'Retrieving graphic capabilities of your display'
Google
Advertise here!