Article View: borland.public.cppbuilder.nativeapi
Article #8510Re: Downloading a file from FTP-server via API: FtpGetFile( )
From: Hans Galema
Date: Wed, 20 Oct 2004 06:09
Date: Wed, 20 Oct 2004 06:09
49 lines
2699 bytes
2699 bytes
Oren Halvani wrote:
> HINTERNET handle_Session = InternetOpen("My App",
> 0,
> 0,
> NULL,
> INTERNET_FLAG_ASYNC),
>
if(! handle_Session)
{
ShowMessage("Open Session = failed !");
return;
}
> handle_Connect = InternetConnect(handle_Session,
> "83.133.48.22",
> INTERNET_DEFAULT_FTP_PORT,
> user.c_str(),
> pass.c_str(),
> INTERNET_SERVICE_FTP,
> 0,
> INTERNET_FLAG_CACHE_ASYNC);
make the last parameter 0:
0);
>
> if(handle_Session) ShowMessage("Open Session = successfully !");
> else ShowMessage("Open Session = failed !");
That you should have done before you used the handle.
> if(handle_Connect) ShowMessage("Connection = successfully !");
> else ShowMessage("Connection = failed !");
No:
if(! handle_Connect)
{
InternetCloseHandle(handle_Session)
ShowMessage("Connection = failed !");
return;
}
HAns.
Technical Details
Message-ID:
<4176004f@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.wirehub.nl!194.72.7.126.MISMATCH!news-peer-test!btnet!newsfeed.bt.es!195.5.65.34.MISMATCH!caladan.arrakis.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4175072a$1@newsgroups.borland.com> <417510a8$1@newsgroups.borland.com> <417513d7@newsgroups.borland.com> <417553a0$1@newsgroups.borland.com> <4175559b@newsgroups.borland.com> <41755f35$1@newsgroups.borland.com> <4175bfa3$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,8c7cb2fd84899d4c X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 20 Oct 2004 08:09:51 +0200 From: Hans Galema <dontusethis@dontusethis.nl> User-Agent: Mozilla Thunderbird 0.7 (Windows/20040616) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Downloading a file from FTP-server via API: FtpGetFile( ) References: <4175072a$1@newsgroups.borland.com> <417510a8$1@newsgroups.borland.com> <417513d7@newsgroups.borland.com> <417553a0$1@newsgroups.borland.com> <4175559b@newsgroups.borland.com> <41755f35$1@newsgroups.borland.com> <4175bfa3$1@newsgroups.borland.com> In-Reply-To: <4175bfa3$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 129.125.201.248 Message-ID: <4176004f@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1098252367 129.125.201.248 (19 Oct 2004 23:06:07 -0700) Lines: 49 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.wirehub.nl!194.72.7.126.MISMATCH!news-peer-test!btnet!newsfeed.bt.es!195.5.65.34.MISMATCH!caladan.arrakis.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail