Re: How to use FTP functions
From: Paul G. Tobey [eMVP] (ptobey)
Date: 11/04/04
- Next message: Paul G. Tobey [eMVP]: "Re: CF driver for PXA255/270"
- Previous message: Paul G. Tobey [eMVP]: "Re: How the NdisUio is implemented for Windows CE platform"
- In reply to: kamaal: "How to use FTP functions"
- Next in thread: kamaal: "Re: How to use FTP functions"
- Reply: kamaal: "Re: How to use FTP functions"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 4 Nov 2004 09:16:08 -0700
I've stripped the error checking from the code below, but it retrieves a
file from an FTP server.
// Create internet connection.
HINTERNET h = InternetOpen( _T( "FTPTest" ), INTERNET_OPEN_TYPE_PRECONFIG,
NULL, NULL, 0 );
// Connect to FTP server.
// Set user name and password to NULL to use anonymous login.
TCHAR *user = _T( "anonymous" );
TCHAR *password = _T( "none@none.com" );
HINTERNET c = InternetConnect( h, _T( "172.16.12.1" ),
INTERNET_DEFAULT_FTP_PORT,
user, password, INTERNET_SERVICE_FTP, 0, 0 );
// Remove any existing target file from the file system.
TCHAR *targetName = _T( "\\nk.bin" );
if ( !FtpGetFile( c, _T( "nk.bin" ), targetName,
FALSE, 0, FTP_TRANSFER_TYPE_BINARY, 0 ) )
Paul T.
"kamaal" <kamaalwince@rediffmail.com> wrote in message
news:dd2f4359.0411040018.5b96df72@posting.google.com...
> Hi all,
>
> I want to implement ftp file transfers from host m/c to the target
> board using a program.The target board is the ftp client and the host
> m/c is the ftp server.
> I have to use the functions InternetOpen() and InternetConnect() as
> follows:
>
> HINTERNET InternetOpen(
> LPCTSTR lpszAgent,
> DWORD dwAccessType,
> LPCTSTR lpszProxyName,
> LPCTSTR lpszProxyBypass,
> DWORD dwFlags
> );
>
> Here, what is the first argument " LPCTSTR lpszAgent" of this
> function?If I want to invoke ftp transfer,what should this argument
> be?I'm using this function as follows:
>
> hInternet=InternetOpen(TEXT("ftpclient"),INTERNET_OPEN_TYPE_DIRECT,NULL,NULL,0);
>
> if(hInternet==NULL)
>
> RETAILMSG(1,(TEXT("InternetOpen failure %d\n"),GetLastError()));
> else
> {
>
> if(!(ftpHandle=InternetConnect(hInternet,L"ftp://xxx.xxx.yy.yy",INTERNET_DEFAULT_FTP_PORT,NULL,NULL,INTERNET_SERVICE_FTP,INTERNET_FLAG_PASSIVE,0)))
>
>
> RETAILMSG(1,(TEXT("InternetConnect failure %d\n"),GetLastError()));
>
> }
>
> But I'm getting error code 12029 in the function InternetConnect().
>
> What's wrong?I'm specifying proper host IP address."ftpclient" is the
> name of my application program.
>
> Kindly help me.
>
> Regards,
> Kamaal
- Next message: Paul G. Tobey [eMVP]: "Re: CF driver for PXA255/270"
- Previous message: Paul G. Tobey [eMVP]: "Re: How the NdisUio is implemented for Windows CE platform"
- In reply to: kamaal: "How to use FTP functions"
- Next in thread: kamaal: "Re: How to use FTP functions"
- Reply: kamaal: "Re: How to use FTP functions"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|