Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Adding and deleting Scheduled Tasks using NetScheduleJob API functions
Enumerating data formats currently available on the clipboard
Winsock: sending email messages (SMTP, port 25)
Custom GDI+ class
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Converting Unicode data from the Clipboard to a character string using a given code page
Mapping and disconnecting network drives
How to download a file from the FTP server using FtpGetFile
Detecting changes in connections to removable drives (VFP9)
How to play AVI file on the _screen
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
How to display the Properties dialog box for a file (ShellExecuteEx)
Custom FTP Class for Visual FoxPro application
Custom HttpRequest class (WinHTTP)
Using EnumPrinters function to enumerate locally installed printers
Winsock: retrieving directory listing from an FTP server using passive data connection (FTP, port 21)
Deleting files into the Recycle Bin
Creating the Open dialog box to specify the drive, directory, and name of a file to open
Disk in drive A:
How to activate Windows Calculator
Splash Screen for the VFP application
Custom HttpRequest class (WinINet)
Enumerating network resources
Creating a directory on the FTP

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
Versions:
click to open
 
#DEFINE INTERNET_INVALID_PORT_NUMBER  0 
#DEFINE INTERNET_OPEN_TYPE_DIRECT     1 
#DEFINE INTERNET_SERVICE_FTP          1 
#DEFINE INTERNET_SERVICE_GOPHER       2 
#DEFINE INTERNET_SERVICE_HTTP         3 
DO decl
 
* initialize access to Inet functions 
hOpen = InternetOpen ("w32ftpdir", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0) 
 
IF hOpen = 0 
        ? "Unable to get access to WinInet.Dll" 
    RETURN 
ENDIF 
 
* put valid FTP connection settings here
strHost = "???"
strUser = "???"
strPwd  = "???"
 
* connect to the FTP 
hFtpSession = InternetConnect (hOpen, strHost,;
        INTERNET_INVALID_PORT_NUMBER,; 
        strUser, strPwd, INTERNET_SERVICE_FTP, 0, 0) 
 
IF hFtpSession <> 0 
    IF FtpCreateDirectory (hFtpSession, "mydir" + SUBSTR(SYS(3),5)) = 1
        ? "The new directory created"
    ELSE
        ? "Unable to create a new directory"
    ENDIF
ELSE 
    ? "Unable to connect to the selected FTP"
ENDIF 
 
* close FTP connection and Wininet access
= InternetCloseHandle (hFtpSession)
= InternetCloseHandle (hOpen)
 
PROCEDURE  decl
    DECLARE INTEGER InternetOpen IN wininet;
        STRING sAgent, INTEGER lAccessType,;
        STRING sProxyName, STRING sProxyBypass,;
        STRING lFlags
 
    DECLARE INTEGER InternetCloseHandle IN wininet INTEGER hInet 
 
    DECLARE INTEGER InternetConnect IN wininet;
        INTEGER hInternetSession, STRING sServerName,; 
        INTEGER nServerPort, STRING sUsername, STRING sPassword,; 
        INTEGER lService, INTEGER lFlags, INTEGER lContext 
 
    DECLARE INTEGER FtpCreateDirectory IN wininet;
        INTEGER hFtpSession, STRING  lpszDirectory
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1574 bytes  
Created: 2001-07-17 12:00:00  
Modified: 2008-10-03 15:25:57  
Visits in 7 days: 82  
Listed functions:
FtpCreateDirectory
InternetCloseHandle
InternetConnect
InternetOpen
Printer friendly API declarations
My comment:


#kwd: sln_ftp.
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 (72.44.48.122)
7.18 min.Function: 'getservbyname'
7.28 min.Function: 'NetMessageNameAdd'
Function group: 'Network Management'
4.21 hrs.Example: 'Round FoxPro form'
 Function: 'MAPILogon'
Function group: 'Simple MAPI'
5.13 hrs.Function: 'DeleteEnhMetaFile'
5.37 hrs.Function: 'StartPage'
5.75 hrs.Function: 'GdipScaleTextureTransform'
6.31 hrs.Example: 'How to play MIDI notes'
17.47 hrs.Example: 'Windows Shell Icons displayed and exported to ICO files (Vista)'
19.91 hrs.Function: 'GetFocus'
Google
Advertise here!