Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp vb.net 1

Status
Not open for further replies.

angela4eva

Programmer
Apr 29, 2005
46
US
hi friends..
i am currently using command file arguments to upload files to a server manually..i would like to do it in vb.net program..please help
C:\upload\>Ftp
FTP> open <ipaddress>
username:<username>
password:<password>

ftp>binary
ftp> put <filename> <filename>
--please let me know how i can do this programtically using vb.net..
thanks
 
but i need to loop through every file in the folder and upload it?is it possible with this?
 
You can use 2 ways:

my.Computer.Network.UploadFile(......)

or

use

Private Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" (ByVal hFtpSession As Integer, ByVal lpszLocalFile As String, ByVal lpszRemoteFile As String, ByVal dwFlags As Integer, ByVal dwContext As Integer) As Boolean

The above should get u started on the correct path.
 
Try the wininet.dll, I have used it for some time now and we works well.

The only negative that I have found it that you have to use a relative path with your directories instead of declaring the directory you want to use.

You will probably want to do search on wininet.dll and look at some more complete examples.

Mike
 
Yeah, for simple uploads works well. I would recommend encrypting the password in the app.config file as well. Glad I could be of assistance.
 
arznrchrd,
How can i check the file of the file on remote server?
thanks
 
See response to your other new post...I am assuming same thing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top