Ftp rename vb.net

venerdì 10 dicembre 2010 - 14.38
Tag Elenco Tags  VB.NET

blackspidy14 Profilo | Junior Member

ciao a tutti!

grazie alla fantastica guida di Giovanni Ferron presente qui sul forum ho realizzato un piccola client ftp. Ora però non ho trovato un esempio chiaro su come rinominare un file presente su un server ftp.

Avete qualche suggermento?

Grazie!

alx_81 Profilo | Guru

>ciao a tutti!
ciao

>grazie alla fantastica guida di Giovanni Ferron presente qui
>sul forum ho realizzato un piccola client ftp. Ora però non ho
>trovato un esempio chiaro su come rinominare un file presente
>su un server ftp.
>Avete qualche suggermento?
questa è una libreria per .net 2.0: http://www.codeproject.com/KB/IP/FtpClient.aspx?fid=225949&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=201

e questo sembra un esempio valido:
http://social.msdn.microsoft.com/forums/en-US/netfxnetcom/thread/8c541130-b571-4b1a-9117-ac610f3e8b34

> Grazie!
di nulla!

--
Alessandro Alpi | SQL Server MVP
MCP|MCITP|MCTS|MCT

http://www.alessandroalpi.net
http://blogs.dotnethell.it/suxstellino
http://mvp.support.microsoft.com/profile/Alessandro.Alpi

blackspidy14 Profilo | Junior Member


>questa è una libreria per .net 2.0: http://www.codeproject.com/KB/IP/FtpClient.aspx?fid=225949&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=201

scusa la mia ignoranza ma la libreria su codeproject l'avevo già trovata ma nn sapevo come usarla io ho uso vb e c# faccio fatica ad usarlo hai qulache suggerimento o libro o articolo da suggerirmi al riguardo?

blackspidy14 Profilo | Junior Member

grazie per l'interessamento il tuo aiuto è stato decisivo, ho risolto e posto il codice per eventuali altri utenti che magari possono averne bisogno. (anche se nn credo perchè è una cosa molto banale!)

'ftp request access info
Dim FtpRequest As FtpWebRequest = WebRequest.Create("ftp://" & hostTxt.Text & "/test.txt")
FtpRequest.Credentials = New NetworkCredential(usernameTxt.Text, passwordTxt.Text)
'ftp metodo
FtpRequest.Method = WebRequestMethods.Ftp.Rename
'ftp rename file
FtpRequest.RenameTo = "test_old.txt"
'ftp response per chiudere l'operazione
Dim FtpResponse As FtpWebResponse = FtpRequest.GetResponse
FtpResponse = CType(FtpRequest.GetResponse(), FtpWebResponse)

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