01.
Private
Sub
Form1_Load(sender
As
Object
, e
As
EventArgs)
02.
03.
End
Sub
04.
05.
Private
Sub
button1_Click(sender
As
Object
, e
As
EventArgs)
06.
Dim
myWebClient
As
New
WebClient()
07.
Dim
fileName
As
String
= textBox1.Text
08.
Dim
_path
As
String
= Application.StartupPath
09.
MessageBox.Show(_path)
10.
_path = _path.Replace(
"Debug"
,
"Images"
)
11.
MessageBox.Show(_path)
12.
myWebClient.UploadFile(_path, fileName)
13.
End
Sub
14.
15.
Private
Sub
btnBrowse_Click(sender
As
Object
, e
As
EventArgs)
16.
Dim
ofDlg
As
New
OpenFileDialog()
17.
ofDlg.Filter =
"JPG|*.jpg|GIF|*.gif|PNG|*.png|BMP|*.bmp"
18.
If
DialogResult.OK = ofDlg.ShowDialog()
Then
19.
textBox1.Text = ofDlg.FileName
20.
button1.Enabled =
True
21.
Else
22.
MessageBox.Show(
"Go ahead, select a file!"
)
23.
End
If
24.
25.
End
Sub
26.
27.
Private
Sub
textBox1_TextChanged(sender
As
Object
, e
As
EventArgs)
28.
If
textBox1.Text =
""
Then
29.
button1.Enabled =
False
30.
End
If
31.
End
Sub