Da un winform copiare un file su webserver il path???

martedì 11 ottobre 2005 - 12.00

albegila82 Profilo | Newbie

da un winnform devo copiare un file locale su un webserver.
come devo scriver il path della cartella (condivisione web) dove caricare il file locale???

col percorso della directory virtuale

"http://nomeserver/progetto/cartella_upload/pippo.txt"

oppure

"\\nomeserver\inetpub\wwwroot\progetto\cartella_upload\pippo.txt"


**********************************************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim fileLocale, fileServer As String
fileLocale = "C:\pippo.txt"
fileServer = "http://nomeserver/progetto/cartella_upload/pippo.txt"
CreaCopia(fileLocale, fileServer)



End Sub



Private Sub CreaCopia(ByVal pathFileLocale As String, ByVal pathFileServer As String)
' Dim alert As New libreria_utility.StringheHTML

Dim sss As String
Dim fileLocale As New System.IO.FileInfo(pathFileLocale)
Label1.Text = ""
If Not fileLocale.Exists Then
Label1.Text = "FILE NON ANCORA SALVATO O INESISTENTE"
Else
Try
fileLocale.CopyTo(pathFileServer)
Label1.Text = "FILE CARICATO CORRETTAMENTE SUL SERVER"
Catch ex As Exception
Label1.Text = ex.Message
End Try

End If

End Sub


End Class

*************************************************


vi ringrazio!!!!!
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