[ASP.NET 2.0] Creazione client ftp

giovedì 16 febbraio 2006 - 11.40

D79 Profilo | Junior Member

Ho la necessità di inviare dei file ad uns erver remoto tramite ftp.
Qualcuno saprebbe indirizzarmi verso la via giusta?... ho cercato ma nonmi sembra che esistano già delle classi specifiche per la gestione dell'ftp...

totti240282 Profilo | Guru

sulla msdn c'è un ottimo esempio lo usato tempo fa...veramente ottimo quello che mancava all framework 1.1.

Fai una ricerca con ftpwebrequest.

C'è solo un capitano !!!!!!

D79 Profilo | Junior Member

ecco la mia porzione di codice, per adesso vorrei solo la lista dei documenti nel server ftp:

Dim URI As String = strFtpHost
Dim ftpClient As System.Net.FtpWebRequest = CType(FtpWebRequest.Create(URI), FtpWebRequest)
ftpClient.Credentials = New NetworkCredential(strFtpUser, strFtpPwd)
ftpClient.Proxy = Nothing
ftpClient.UseBinary = False
ftpClient.UsePassive = True
ftpClient.Method = WebRequestMethods.Ftp.ListDirectoryDetails
Dim response As FtpWebResponse = CType(ftpClient.GetResponse(), FtpWebResponse)

all'ultima riga mi da' un'eccezione:
The server returned an address in response to the PASV command that is different than the address to which the FTP connection was made.

----
il mio sito: http://it.geocities.com/chuck_dust/

totti240282 Profilo | Guru

forse devi impostare l'invio passivo o viceversa ???

C'è solo un capitano !!!!!!

totti240282 Profilo | Guru

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=235791&SiteID=1

C'è solo un capitano !!!!!!

D79 Profilo | Junior Member

si infatti ho provato così ma il server ftp dà questo errore

425 Can't open data connection.

----
il mio sito: http://it.geocities.com/chuck_dust/
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5