Advertisement
Dev

FTP File Upload Via VB Program Source

Dev
Oct 18th, 2015
30,122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. Public Class Form1
  2.  
  3. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  4. If TextBox1.Text & TextBox2.Text = "" Then
  5. MsgBox("Wrong FTP Details")
  6. Else
  7. Try
  8. My.Computer.Network.UploadFile(TextBox3.Text, ComboBox1.SelectedItem + TextBox4.Text + "/" + Label5.Text, TextBox1.Text, TextBox2.Text, True, 500)
  9. Catch ex As Exception
  10. MsgBox(ex.Message)
  11. End Try
  12. TextBox5.Text = "http://" + TextBox4.Text + "/" + Label5.Text
  13. End If
  14. End Sub
  15.  
  16. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  17. OpenFileDialog1.ShowDialog()
  18. OpenFileDialog1.Title = "Choose a File!"
  19. TextBox3.Text = OpenFileDialog1.FileName
  20. Label5.Text = OpenFileDialog1.SafeFileName
  21. End Sub
  22.  
  23. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  24. ComboBox1.SelectedIndex = 0
  25. End Sub
  26.  
  27. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  28. If TextBox5.Text = "" Then
  29. MsgBox("No Text To Copy")
  30. Else
  31. Clipboard.SetText(TextBox5.Text)
  32. End If
  33. End Sub
  34. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement