Ciao,
mi pare di avere visto da qualche parte qualche indicazione di come creare una cartella su un'area FTP.
Non mi pare che con la classe TFTP o TFTPFile si riesca a farlo, eppure mi pareva di avere visto qualcosa in giro.
Qualche indicazione utile ?
FWH 2.4
Grazie
Romeo/Zingoni
Creare una cartella sul area FTP
Moderator: Enrico Maria Giordano
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Creare una cartella sul area FTP
Code: Select all
STATIC FUNCTION FTPCREATEDIR( cFtp, cPer, cUsr, cPsw, cDir )
LOCAL hInternet, hConnect
LOCAL lOk
hInternet = INTERNETOPEN( "Anystring", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )
hConnect = INTERNETCONNECT( hInternet, cFtp, INTERNET_INVALID_PORT_NUMBER, cUsr, cPsw, INTERNET_SERVICE_FTP, 0, 0 )
lOk = FTPCREATEDIRECTORY( hConnect, cPer + "/" + cDir )
INTERNETCLOSEHANDLE( hConnect )
INTERNETCLOSEHANDLE( hInternet )
RETURN lOk
Code: Select all
#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
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Ciao EMG, compilando con FWH24 un minimale esempio.prg mi da i seg.errori:
Error: Unresolved external 'InternetOpenA'
Error: Unresolved external 'InternetCloseHandle'
Error: Unresolved external 'InternetConnectA'
Error: Unresolved external 'FtpGetFileA'
Error: Unresolved external 'FtpPutFileA'
Error: Unresolved external 'FtpDeleteFileA'
Error: Unresolved external 'FtpCreateDirectoryA'
Error: Unresolved external 'FtpRemoveDirectoryA'
Error: Unresolved external 'FtpFindFirstFileA'
Error: Unresolved external 'InternetFindNextFileA'
Grazie
Romeo
Error: Unresolved external 'InternetOpenA'
Error: Unresolved external 'InternetCloseHandle'
Error: Unresolved external 'InternetConnectA'
Error: Unresolved external 'FtpGetFileA'
Error: Unresolved external 'FtpPutFileA'
Error: Unresolved external 'FtpDeleteFileA'
Error: Unresolved external 'FtpCreateDirectoryA'
Error: Unresolved external 'FtpRemoveDirectoryA'
Error: Unresolved external 'FtpFindFirstFileA'
Error: Unresolved external 'InternetFindNextFileA'
Grazie
Romeo
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact: