kapiaba Posted August 30, 2017 Report Share Posted August 30, 2017 /* usando: wininet.lib. echo %bcdir%\lib\psdk\wininet.lib + >> b32.bc */ #include "Fivewin.ch" // // File attributes // #define FILE_ATTRIBUTE_READONLY 1 #define FILE_ATTRIBUTE_HIDDEN 2 #define FILE_ATTRIBUTE_SYSTEM 4 #define FILE_ATTRIBUTE_DIRECTORY 16 #define FILE_ATTRIBUTE_ARCHIVE 32 #define FILE_ATTRIBUTE_NORMAL 128 #define FILE_ATTRIBUTE_TEMPORARY 256 // // access types for InternetOpen() // #define INTERNET_OPEN_TYPE_PRECONFIG 0 // use registry configuration #define INTERNET_OPEN_TYPE_DIRECT 1 // direct to net #define INTERNET_OPEN_TYPE_PROXY 3 // via named proxy #define INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY 4 // prevent using java/script/INS // // manifests // #define INTERNET_INVALID_PORT_NUMBER 0 // use the protocol-specific default #define INTERNET_DEFAULT_FTP_PORT 21 // default for FTP servers #define INTERNET_DEFAULT_GOPHER_PORT 70 // " " gopher " #define INTERNET_DEFAULT_HTTP_PORT 80 // " " HTTP " #define INTERNET_DEFAULT_HTTPS_PORT 443 // " " HTTPS " #define INTERNET_DEFAULT_SOCKS_PORT 1080 // default for SOCKS firewall servers. // // service types for InternetConnect() // #define INTERNET_SERVICE_FTP 1 #define INTERNET_SERVICE_GOPHER 2 #define INTERNET_SERVICE_HTTP 3 // // flags for FTP // #define INTERNET_FLAG_TRANSFER_ASCII 1 #define INTERNET_FLAG_TRANSFER_BINARY 2 FUNCTION MAIN() LOCAL hInternet, hConnect hInternet = INTERNETOPEN( "Anystring", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 ) hConnect = INTERNETCONNECT( hInternet, "myftpaddress", INTERNET_INVALID_PORT_NUMBER, "myuserid", "mypassword", INTERNET_SERVICE_FTP, 0, 0 ) ? FTPGETFILE( hConnect, "/emagsoftware.it/test/atest.prg", "atest.prg", 0, FILE_ATTRIBUTE_ARCHIVE, 0, 0 ) // ? FTPPUTFILE( hConnect, "atest.prg", "/emagsoftware.it/test/atest.prg", 0, 0 ) INTERNETCLOSEHANDLE( hConnect ) INTERNETCLOSEHANDLE( hInternet ) RETURN NIL #pragma BEGINDUMP #include "windows.h" #include "wininet.h" #include "hbapi.h" HB_FUNC( INTERNETOPEN ) { hb_retnl( ( LONG ) InternetOpen( hb_parc( 1 ), hb_parnl( 2 ), hb_parc( 3 ), hb_parc( 4 ), hb_parnl( 5 ) ) ); } HB_FUNC( INTERNETCLOSEHANDLE ) { hb_retl( InternetCloseHandle( ( HINTERNET ) hb_parnl( 1 ) ) ); } HB_FUNC( INTERNETCONNECT ) { hb_retnl( ( LONG ) InternetConnect( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ), ( INTERNET_PORT ) hb_parnl( 3 ), hb_parc( 4 ), hb_parc( 5 ), hb_parnl( 6 ), hb_parnl( 7 ), hb_parnl( 8 ) ) ); } HB_FUNC( FTPGETFILE ) { hb_retl( FtpGetFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ), hb_parc( 3 ), hb_parl( 4 ), hb_parnl( 5 ), hb_parnl( 6 ), hb_parnl( 7 ) ) ); } HB_FUNC( FTPPUTFILE ) { hb_retl( FtpPutFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ), hb_parc( 3 ), hb_parnl( 4 ), hb_parnl( 5 ) ) ); } HB_FUNC( FTPDELETEFILE ) { hb_retl( FtpDeleteFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ) ) ); } HB_FUNC( FTPCREATEDIRECTORY ) { hb_retl( FtpCreateDirectory( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ) ) ); } HB_FUNC( FTPREMOVEDIRECTORY ) { hb_retl( FtpRemoveDirectory( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ) ) ); } HB_FUNC( FTPFINDFIRSTFILE ) { hb_retnl( ( LONG ) FtpFindFirstFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ), ( WIN32_FIND_DATA * ) hb_parc( 3 ), hb_parnl( 4 ), hb_parnl( 5 ) ) ); } HB_FUNC( INTERNETFINDNEXTFILE ) { hb_retl( InternetFindNextFile( ( HINTERNET ) hb_parnl( 1 ), hb_parc( 2 ) ) ); } #pragma ENDDUMP Quote Link to comment Share on other sites More sharing options...
devairlp Posted August 31, 2017 Report Share Posted August 31, 2017 Ja tive esse problema para conexão dom FTP, resolvi desta forma. logo abaixo desta linha: oFTP := TFTP():New( Alltrim(cServFtp), oInternet, Alltrim(cUserFtp),Alltrim(cPassFtp) ) coloque isso, oFTP:lPassive := .T. Espero que de certo pra vc. Quote Link to comment Share on other sites More sharing options...
dorneles Posted August 31, 2017 Report Share Posted August 31, 2017 o problema esta com TIpClientFtp Warning BASE/1.005 Message not found: TIPCLIENTFTP:_LPASSIVE Quote Link to comment Share on other sites More sharing options...
dorneles Posted August 31, 2017 Report Share Posted August 31, 2017 Posta o restante do seu codigo utilizando a TFTP() Quote Link to comment Share on other sites More sharing options...
kapiaba Posted August 31, 2017 Report Share Posted August 31, 2017 Testem essa aqui também: http://forums.fivetechsupport.com/viewtopic.php?f=3&t=25416 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted August 31, 2017 Report Share Posted August 31, 2017 Tentem também desbloquear o firewall: http://fivetechsupport.com/forums/viewtopic.php?f=3&t=30115&start=0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.