Private Sub Form1_Load(sender As Object, e As EventArgs)
End Sub
Private Sub button1_Click(sender As Object, e As EventArgs)
Dim myWebClient As New WebClient()
Dim fileName As String = textBox1.Text
Dim _path As String = Application.StartupPath
MessageBox.Show(_path)
_path = _path.Replace("Debug", "Images")
MessageBox.Show(_path)
myWebClient.UploadFile(_path, fileName)
End Sub
Private Sub btnBrowse_Click(sender As Object, e As EventArgs)
Dim ofDlg As New OpenFileDialog()
ofDlg.Filter = "JPG|*.jpg|GIF|*.gif|PNG|*.png|BMP|*.bmp"
If DialogResult.OK = ofDlg.ShowDialog() Then
textBox1.Text = ofDlg.FileName
button1.Enabled = True
Else
MessageBox.Show("Go ahead, select a file!")
End If
End Sub
Private Sub textBox1_TextChanged(sender As Object, e As EventArgs)
If textBox1.Text = "" Then
button1.Enabled = False
End If
End Sub