Otra de FTP

Otra de FTP

Postby JmGarcia » Fri Sep 25, 2009 11:35 am

Este código fuente me da error: Cannot load WinINet.dll (la DLL este en su sitio C:\windows\system32) :cry:

Code: Select all  Expand view
oInternet:=TInternet():New()
oFTP:=TFTP():New("ftp.pepe.es",oInternet,"usuario","contraseña")
FtpGetFile (oFTP:hFTP,"/tmp/fichero.jpg","c:\tmp\fichero.jpg",.T.,0,0,0 )


Lo que pretendo es, simplemente, conectarme a un servidor FTP y coger un fichero, nada mas. :oops:
Algún código fuente alternativo. :roll:

Gracias.
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: Otra de FTP

Postby QAZWSX2K » Fri Sep 25, 2009 2:38 pm

LA SINTAXIS DIRECTA ES ASI

ftp://USUARIO:CLAVE@IP/
Software especializado para oficinas contables con grandes volumenes de Informacion
Impresion de todos los formularios del Seniat, Dian

alex_patino74@hotmail.com
whatsapp 57+3214777217
User avatar
QAZWSX2K
 
Posts: 364
Joined: Tue Oct 25, 2005 7:06 pm
Location: Bogota - Caracas

Re: Otra de FTP

Postby JmGarcia » Fri Sep 25, 2009 9:59 pm

QAZWSX2K wrote:LA SINTAXIS DIRECTA ES ASI
ftp://USUARIO:CLAVE@IP/


Con esa notación tengo el problema del nombre de usuario, contiene una "@".

Funcionaría así ftp://JMGARCIA@YA.COM:CLAVE@IP/
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: Otra de FTP

Postby JmGarcia » Sat Sep 26, 2009 10:33 am

QAZWSX2K wrote:LA SINTAXIS DIRECTA ES ASI

ftp://USUARIO:CLAVE@IP/


Me sigue dando el mismo error :oops:
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: Otra de FTP

Postby JmGarcia » Thu Oct 01, 2009 6:32 pm

He compilado el ejemplo C:\...\samples\gallery\icopyfil y me da el mismo error Cannot load WinINet.dll

:oops: :roll:
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: Otra de FTP

Postby QAZWSX2K » Thu Oct 01, 2009 6:52 pm

HAS PROBADO PONER LA DLL EN EL MISMO DIRECTORIO DEL EJECUTABLE¿?
Software especializado para oficinas contables con grandes volumenes de Informacion
Impresion de todos los formularios del Seniat, Dian

alex_patino74@hotmail.com
whatsapp 57+3214777217
User avatar
QAZWSX2K
 
Posts: 364
Joined: Tue Oct 25, 2005 7:06 pm
Location: Bogota - Caracas

Re: Otra de FTP

Postby JmGarcia » Fri Oct 02, 2009 7:20 am

QAZWSX2K wrote:HAS PROBADO PONER LA DLL EN EL MISMO DIRECTORIO DEL EJECUTABLE¿?

Pues me sigue dando el mismo error... uso FWH 0908.
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: Otra de FTP

Postby QAZWSX2K » Fri Oct 02, 2009 12:47 pm

has probado registrando la dll en windows con regsvr32.exe
Software especializado para oficinas contables con grandes volumenes de Informacion
Impresion de todos los formularios del Seniat, Dian

alex_patino74@hotmail.com
whatsapp 57+3214777217
User avatar
QAZWSX2K
 
Posts: 364
Joined: Tue Oct 25, 2005 7:06 pm
Location: Bogota - Caracas

Re: Otra de FTP

Postby JmGarcia » Fri Oct 02, 2009 9:19 pm

QAZWSX2K wrote:has probado registrando la dll en windows con regsvr32.exe

Buena idea...

He hecho esto:
REGSVR32 C:\WINDOWS\system32\wininet.dll

...y me dice que:
Se descargó REGSVR32 C:\WINDOWS\system32\wininet.dll, pero no se encontró el punto de entrada DLLRegisterServer.
No se puede registrar este archivo.
Last edited by JmGarcia on Fri Oct 02, 2009 9:28 pm, edited 1 time in total.
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: Otra de FTP

Postby cuatecatl82 » Fri Oct 02, 2009 9:28 pm

Hola JmGarcia:

Lo hago con esta sintaxis: :idea:

Code: Select all  Expand view
Winexec(GetWinDir()+"\REGSVR32 WinINet.dll /s-")


Debes tener el Archivo REGSVR32.EXE que trae WinXP, en Vista desconosco como se pueda regsitrar una dll. :oops:

Prueba así ojala y pueda funcionarte..

Saludos... :D
Soluciones y Diseño de Software
Damos Soluciones...

I.S.C. Victor Daniel Cuatecatl Leon
Director y Diseñador de Proyectos

http://www.soldisoft.unlugar.com
http://www.sisa.unlugar.com
danyleon82@hotmail.com
www.facebook.com/victordaniel.cuatecatlleon
User avatar
cuatecatl82
 
Posts: 625
Joined: Wed Mar 14, 2007 6:49 pm
Location: San Cristobal de las Casas, Chiapas México

Re: Otra de FTP

Postby JmGarcia » Fri Oct 02, 2009 9:36 pm

Lo he hecho asi:
C:\WINDOWS\system32>REGSVR32 wininet.dll /s-

Y nada, me sigue el mismo error :cry: :oops:
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: Otra de FTP

Postby QAZWSX2K » Mon Oct 05, 2009 1:59 pm

yo pensaria seriamente que esa dll esta corrupta, ve si puedes conseguir otra copia
Software especializado para oficinas contables con grandes volumenes de Informacion
Impresion de todos los formularios del Seniat, Dian

alex_patino74@hotmail.com
whatsapp 57+3214777217
User avatar
QAZWSX2K
 
Posts: 364
Joined: Tue Oct 25, 2005 7:06 pm
Location: Bogota - Caracas

Re: Otra de FTP

Postby QAZWSX2K » Mon Oct 05, 2009 2:07 pm

la que yo tengo en mi maquina es de 807 kb, de fecha 26-08-2008 4.11 am
Software especializado para oficinas contables con grandes volumenes de Informacion
Impresion de todos los formularios del Seniat, Dian

alex_patino74@hotmail.com
whatsapp 57+3214777217
User avatar
QAZWSX2K
 
Posts: 364
Joined: Tue Oct 25, 2005 7:06 pm
Location: Bogota - Caracas

Re: Otra de FTP

Postby JmGarcia » Mon Oct 05, 2009 9:13 pm

QAZWSX2K wrote:yo pensaria seriamente que esa dll esta corrupta, ve si puedes conseguir otra copia
QAZWSX2K wrote:la que yo tengo en mi maquina es de 807 kb, de fecha 26-08-2008 4.11 am

Me pasa en todos los ordenadores XP que pruebo.
El tamaño coincide con el tuyo.
Debe ser cosa del FWH0908 :cry:
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.
FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
User avatar
JmGarcia
 
Posts: 654
Joined: Mon May 29, 2006 3:14 pm
Location: Madrid - ESPAÑA

Re: Otra de FTP

Postby QAZWSX2K » Tue Oct 06, 2009 12:44 pm

CHEQUEA ESTE LINK A VER SI TE SIRVE DE AYUDA http://www.freevbcode.com/ShowCode.asp?ID=1991



CONTENIDO SEGUN http://foro.elhacker.net/net/ayudasubir_archivos_por_ftp-t265864.0.html

Const FTP_TRANSFER_TYPE_UNKNOWN = &H0
Const FTP_TRANSFER_TYPE_ASCII = &H1
Const FTP_TRANSFER_TYPE_BINARY = &H2
Const INTERNET_DEFAULT_FTP_PORT = 21 ' default for FTP servers
Const INTERNET_SERVICE_FTP = 1
Const INTERNET_FLAG_PASSIVE = &H8000000 ' used for FTP connections
Const INTERNET_OPEN_TYPE_PRECONFIG = 0 ' use registry configuration
Const INTERNET_OPEN_TYPE_DIRECT = 1 ' direct to net
Const INTERNET_OPEN_TYPE_PROXY = 3 ' via named proxy
Const INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY = 4 ' prevent using java/script/INS
Const MAX_PATH = 260
Private Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type
Private Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * MAX_PATH
cAlternate As String * 14
End Type
Private Declare Function InternetCloseHandle Lib "wininet" (ByRef hInet As Long) As Long
Private Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA" (ByVal hInternetSession As Long, ByVal sServerName As String, ByVal nServerPort As Integer, ByVal sUserName As String, ByVal sPassword As String, ByVal lService As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long
Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
Private Declare Function FtpSetCurrentDirectory Lib "wininet.dll" Alias "FtpSetCurrentDirectoryA" (ByVal hFtpSession As Long, ByVal lpszDirectory As String) As Boolean
Private Declare Function FtpGetCurrentDirectory Lib "wininet.dll" Alias "FtpGetCurrentDirectoryA" (ByVal hFtpSession As Long, ByVal lpszCurrentDirectory As String, lpdwCurrentDirectory As Long) As Long
Private Declare Function FtpCreateDirectory Lib "wininet.dll" Alias "FtpCreateDirectoryA" (ByVal hFtpSession As Long, ByVal lpszDirectory As String) As Boolean
Private Declare Function FtpRemoveDirectory Lib "wininet.dll" Alias "FtpRemoveDirectoryA" (ByVal hFtpSession As Long, ByVal lpszDirectory As String) As Boolean
Private Declare Function FtpDeleteFile Lib "wininet.dll" Alias "FtpDeleteFileA" (ByVal hFtpSession As Long, ByVal lpszFileName As String) As Boolean
Private Declare Function FtpRenameFile Lib "wininet.dll" Alias "FtpRenameFileA" (ByVal hFtpSession As Long, ByVal lpszExisting As String, ByVal lpszNew As String) As Boolean
Private Declare Function FtpGetFile Lib "wininet.dll" Alias "FtpGetFileA" (ByVal hConnect As Long, ByVal lpszRemoteFile As String, ByVal lpszNewFile As String, ByVal fFailIfExists As Long, ByVal dwFlagsAndAttributes As Long, ByVal dwFlags As Long, ByRef dwContext As Long) As Boolean
Private Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" (ByVal hConnect As Long, ByVal lpszLocalFile As String, ByVal lpszNewRemoteFile As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean
Private Declare Function InternetGetLastResponseInfo Lib "wininet.dll" Alias "InternetGetLastResponseInfoA" (lpdwError As Long, ByVal lpszBuffer As String, lpdwBufferLength As Long) As Boolean
Private Declare Function FtpFindFirstFile Lib "wininet.dll" Alias "FtpFindFirstFileA" (ByVal hFtpSession As Long, ByVal lpszSearchFile As String, lpFindFileData As WIN32_FIND_DATA, ByVal dwFlags As Long, ByVal dwContent As Long) As Long
Private Declare Function InternetFindNextFile Lib "wininet.dll" Alias "InternetFindNextFileA" (ByVal hFind As Long, lpvFindData As WIN32_FIND_DATA) As Long
Const PassiveConnection As Boolean = True
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net
'E-Mail: KPDTeam@allapi.net
Dim hConnection As Long, hOpen As Long, sOrgPath As String
'open an internet connection
hOpen = InternetOpen("API-Guide sample program", INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, 0)
'connect to the FTP server
hConnection = InternetConnect(hOpen, "your ftp server", INTERNET_DEFAULT_FTP_PORT, "your login", "your password", INTERNET_SERVICE_FTP, IIf(PassiveConnection, INTERNET_FLAG_PASSIVE, 0), 0)
'create a buffer to store the original directory
sOrgPath = String(MAX_PATH, 0)
'get the directory
FtpGetCurrentDirectory hConnection, sOrgPath, Len(sOrgPath)
'create a new directory 'testing'
FtpCreateDirectory hConnection, "testing"
'set the current directory to 'root/testing'
FtpSetCurrentDirectory hConnection, "testing"
'upload the file 'test.htm'
FtpPutFile hConnection, "C:\test.htm", "test.htm", FTP_TRANSFER_TYPE_UNKNOWN, 0
'rename 'test.htm' to 'apiguide.htm'
FtpRenameFile hConnection, "test.htm", "apiguide.htm"
'enumerate the file list from the current directory ('root/testing')
EnumFiles hConnection
'retrieve the file from the FTP server
FtpGetFile hConnection, "apiguide.htm", "c:\apiguide.htm", False, 0, FTP_TRANSFER_TYPE_UNKNOWN, 0
'delete the file from the FTP server
FtpDeleteFile hConnection, "apiguide.htm"
'set the current directory back to the root
FtpSetCurrentDirectory hConnection, sOrgPath
'remove the direcrtory 'testing'
FtpRemoveDirectory hConnection, "testing"
'close the FTP connection
InternetCloseHandle hConnection
'close the internet connection
InternetCloseHandle hOpen
End Sub
Public Sub EnumFiles(hConnection As Long)
Dim pData As WIN32_FIND_DATA, hFind As Long, lRet As Long
'set the graphics mode to persistent
Me.AutoRedraw = True
'create a buffer
pData.cFileName = String(MAX_PATH, 0)
'find the first file
hFind = FtpFindFirstFile(hConnection, "*.*", pData, 0, 0)
'if there's no file, then exit sub
If hFind = 0 Then Exit Sub
'show the filename
Me.Print Left(pData.cFileName, InStr(1, pData.cFileName, String(1, 0), vbBinaryCompare) - 1)
Do
'create a buffer
pData.cFileName = String(MAX_PATH, 0)
'find the next file
lRet = InternetFindNextFile(hFind, pData)
'if there's no next file, exit do
If lRet = 0 Then Exit Do
'show the filename
Me.Print Left(pData.cFileName, InStr(1, pData.cFileName, String(1, 0), vbBinaryCompare) - 1)
Loop
'close the search handle
InternetCloseHandle hFind
End Sub
Sub ShowError()
Dim lErr As Long, sErr As String, lenBuf As Long
'get the required buffer size
InternetGetLastResponseInfo lErr, sErr, lenBuf
'create a buffer
sErr = String(lenBuf, 0)
'retrieve the last respons info
InternetGetLastResponseInfo lErr, sErr, lenBuf
'show the last response info
MsgBox "Error " + CStr(lErr) + ": " + sErr, vbOKOnly + vbCritical
End Sub
Software especializado para oficinas contables con grandes volumenes de Informacion
Impresion de todos los formularios del Seniat, Dian

alex_patino74@hotmail.com
whatsapp 57+3214777217
User avatar
QAZWSX2K
 
Posts: 364
Joined: Tue Oct 25, 2005 7:06 pm
Location: Bogota - Caracas


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 19 guests