Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Visual Basic] FTP Uploader [Tutorial]
#1
Step One

-Okay, lets design the GUI. Now in this tutorial i will be making the program upload a simple text file so go ahead and make a text file named tests and put it on your desktop. After that, design your GUI and make it look similar to mine. Here is mine...




Step Two

-Step Two will be to add an openfiledialog, and to code the "Browse..." Button.
-Add the openfiledialog and make it whatever you want for the filter. I am doing text files so i will make it Text File(*.txt)|*.txt|All Files|*.*
-Once that is done, double click the Browse button and copy and paste this code for it...

Code:
OpenFileDialog1.ShowDialog()
        TextBox1.Text = OpenFileDialog1.FileName


Step Three

-In this step we will code the hardest part of the program, the "Upload" button. For the sake of this tutorial, just copy and paste my code. Or you can type it out, up to you.
-Double click the Upload button and use this code for it...

Code:
Dim request As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create("Your FTP Server Here"), System.Net.FtpWebRequest)
        request.Credentials = New System.Net.NetworkCredential("user", "pass")
        request.Method = System.Net.WebRequestMethods.Ftp.UploadFile

        Dim file() As Byte = System.IO.File.ReadAllBytes(TextBox1.Text)

        Dim st As System.IO.Stream = request.GetRequestStream()
        st.Write(file, 0, file.Length)
        st.Close()
        st.Dispose()

-You will need to change the info to the server and the credentials to match your own FTP information. But now simply code the "Exit..." button by using Me.Close() and now you are done! Debug to test and save.



Our final code (Click to View)


Still having trouble? Download my source code here...




I TAKE NOT CREDIT FOR THIS CODE. SIMPLY SHARING w/ YOU GUYS
[Image: iddyEs.png]
Reply
#2
Good tutorial, this can be used to make something like gyazo, which i'm doing.
[Image: Untitled-1-4.jpg]
Reply
#3
Very nice tutorial!
Maybe a picture of what it should look like would be helpful Smile
Reply
#4
nice man gonna use very soon
Reply
#5
Can't download it could you upload it again Smile
My profession, you can call me a pothead, 'nuff said
Reply
#6
cant download anymore can you please reupload
Reply
#7
Awesome Share. c:
Blackhat Thumbsup
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How To make an advanced Operating System in Visual Basic 2010 ? Mohamed Samir 9 11,429 01-15-2013, 09:30 PM
Last Post: Resistance
  [RELEASE] Up2Minus [MINUS UPLOADER [RELEASE] Kenneth 2 1,291 09-08-2012, 04:17 PM
Last Post: spesificrelax
  [TuToRiAl] How to make Offline (No Internet) Captcha (Human Confirmation) [TuToRiAl] Resistance 24 10,814 08-30-2012, 10:14 PM
Last Post: Resistance
  Trial App + FTP & Source kpn37z 1 886 08-11-2012, 11:28 PM
Last Post: Kenneth
  Visual Studio Bill Nye The Science Guy 1 885 03-19-2012, 09:08 AM
Last Post: BreShiE

Forum Jump:


Users browsing this thread: 1 Guest(s)