Comunicaçao entre Pocket e PC ?

Comunicaçao entre Pocket e PC ?

Postby Ale SB » Thu Feb 08, 2007 7:41 pm

Boa Tarde;

Tenho que transmitir o Banco de Dados do Palm para o PC via Wireless.

Gostaria de saber que classe usar ?

Seria via FTP ?

Alguem tem algum exemplo pra eu dar uma olhada ?


@braços Ale
aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, você não subtrai quando divide; mas soma e multiplica."
**---Mário Persona---**
User avatar
Ale SB
 
Posts: 248
Joined: Wed Jan 11, 2006 11:30 am
Location: Campo Grande-MS / Brasil

Postby Elias Torres » Fri Feb 09, 2007 11:00 am

Hola Ale...

Si quieres puedes probar con el siguiente codigo via ftp. A mi me ha funcionado... Solo debes modificar un par de cosillas, la ip del ftp, el usuario, la contraseña, el directorio remoto y el local. Espero te sirva.. Por cierto este codigo es del ftp.prg del directorio samples.....


// FTP sample developed by Enrico Maria Giordano

#include "Fwce.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, "Your ftp address", INTERNET_INVALID_PORT_NUMBER, "userid", "password", INTERNET_SERVICE_FTP, 0, 0 )

// ? FTPGETFILE( hConnect, "Your remote file", "Your local file", 0, FILE_ATTRIBUTE_ARCHIVE, 0, 0 )

? FTPPUTFILE( hConnect, "Your local file", "Your remote file", 0, 0 )

INTERNETCLOSEHANDLE( hConnect )

INTERNETCLOSEHANDLE( hInternet )

RETURN NIL


#pragma BEGINDUMP

#include "windows.h"
#include "wininet.h"
#include "hbapi.h"


LPWSTR AnsiToWide( LPSTR );


HB_FUNC( INTERNETOPEN )
{
LPWSTR cAgent = AnsiToWide( hb_parc( 1 ) );
LPWSTR cProxyName = AnsiToWide( hb_parc( 3 ) );
LPWSTR cProxyBypass = AnsiToWide( hb_parc( 4 ) );

HINTERNET hInternet = InternetOpen( cAgent, hb_parnl( 2 ), cProxyName, cProxyBypass, hb_parnl( 5 ) );

hb_xfree( cAgent );
hb_xfree( cProxyName );
hb_xfree( cProxyBypass );

hb_retnl( ( LONG ) hInternet );
}


HB_FUNC( INTERNETCLOSEHANDLE )
{
hb_retl( InternetCloseHandle( ( HINTERNET ) hb_parnl( 1 ) ) );
}


HB_FUNC( INTERNETCONNECT )
{
LPWSTR cServerName = AnsiToWide( hb_parc( 2 ) );
LPWSTR cUserName = AnsiToWide( hb_parc( 4 ) );
LPWSTR cPassword = AnsiToWide( hb_parc( 5 ) );

HINTERNET hInternet = InternetConnect( ( HINTERNET ) hb_parnl( 1 ), cServerName, ( INTERNET_PORT ) hb_parnl( 3 ), cUserName, cPassword, hb_parnl( 6 ), hb_parnl( 7 ), hb_parnl( 8 ) );

hb_xfree( cServerName );
hb_xfree( cUserName );
hb_xfree( cPassword );

hb_retnl( ( LONG ) hInternet );
}


HB_FUNC( FTPGETFILE )
{
LPWSTR cRemoteFile = AnsiToWide( hb_parc( 2 ) );
LPWSTR cNewFile = AnsiToWide( hb_parc( 3 ) );

hb_retl( FtpGetFile( ( HINTERNET ) hb_parnl( 1 ), cRemoteFile, cNewFile, hb_parl( 4 ), hb_parnl( 5 ), hb_parnl( 6 ), hb_parnl( 7 ) ) );

hb_xfree( cRemoteFile );
hb_xfree( cNewFile );
}


HB_FUNC( FTPPUTFILE )
{
LPWSTR cLocalFile = AnsiToWide( hb_parc( 2 ) );
LPWSTR cNewRemoteFile = AnsiToWide( hb_parc( 3 ) );

hb_retl( FtpPutFile( ( HINTERNET ) hb_parnl( 1 ), cLocalFile, cNewRemoteFile, hb_parnl( 4 ), hb_parnl( 5 ) ) );

hb_xfree( cLocalFile );
hb_xfree( cNewRemoteFile );
}

#pragma ENDDUMP




Saludos...

Elías Torres
Elias Torres
 
Posts: 233
Joined: Wed Aug 09, 2006 3:07 pm

Postby Ale SB » Fri Feb 09, 2007 11:42 am

Gracias Elias,

Irei testar.

@braços Ale
aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, você não subtrai quando divide; mas soma e multiplica."
**---Mário Persona---**
User avatar
Ale SB
 
Posts: 248
Joined: Wed Jan 11, 2006 11:30 am
Location: Campo Grande-MS / Brasil


Return to FiveWin para Pocket PC

Who is online

Users browsing this forum: No registered users and 20 guests