Software Development Network>> Visual Basic>> Simple FTP
Cathal is absolutely correct. Additional link for My.Computer.Network.Download:
http://msdn2.microsoft.com/en-us/library/ack30t8y.aspx
Best regards,Johan Stenberg
if you're using vb.net 2.0, then the my namespace has a simple method -My.Computer.Network.Downloadfile http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnvs05/html/MyWalkthro.asp
Catha;
I use this code:
Bold -> Constant Variables
Public Function exportFiles(ByVal path As String, ByVal username As String, ByVal password As String) As String Dim fso As New FileSystemObject Dim shortPath As String Dim iError As Integer Dim wkStr As String shortPath = ShortPathName(path) fso.CreateTextFile path & "\" & fileFtp fso.CreateTextFile path & "\" & fileFtpScript Open path & "\" & fileFtp For Output As #1 wkStr = "%SystemRoot%\system32\FTP.EXE -s:" & shortPath & "\" & fileFtpScript & " " & ftpServer
Print #1, wkStr Close #1 Open path & "\" & fileFtpScript For Output As #2 Print #2, username Print #2, password wkStr = "put " & shortPath & "\" & origFile & " " & destFile
Print #2, wkStr Close #2
Shell (path & "\" & fileFtp)
Simple FTP
Mike Oliver
Cathal is absolutely correct. Additional link for My.Computer.Network.Download:
http://msdn2.microsoft.com/en-us/library/ack30t8y.aspx
Best regards,
Johan Stenberg
TVC15
if you're using vb.net 2.0, then the my namespace has a simple method -My.Computer.Network.Downloadfile http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnvs05/html/MyWalkthro.asp
Catha;
LUCYCARD
I use this code:
Bold -> Constant Variables
Public Function exportFiles(ByVal path As String, ByVal username As String, ByVal password As String) As String
Dim fso As New FileSystemObject
Dim shortPath As String
Dim iError As Integer
Dim wkStr As String
shortPath = ShortPathName(path)
fso.CreateTextFile path & "\" & fileFtp
fso.CreateTextFile path & "\" & fileFtpScript
Open path & "\" & fileFtp For Output As #1
wkStr = "%SystemRoot%\system32\FTP.EXE -s:" & shortPath & "\" & fileFtpScript & " " & ftpServer
Print #1, wkStr
Close #1
Open path & "\" & fileFtpScript For Output As #2
Print #2, username
Print #2, password
wkStr = "put " & shortPath & "\" & origFile & " " & destFile
Print #2, wkStr
Close #2
Shell (path & "\" & fileFtp)