LeonLanford
Active member
- Joined
- Dec 2, 2008
- Messages
- 28
- Programming Experience
- Beginner
Hi.. I'm new here.. I'm using visual studio 2005
I just learnt vb.net not too long ago
I just made application to upload file to website but I have problems
1. How to make progress bar while uploading? I can make progress bar working by pressing a button, but don't know how to do it with uploading..
2. How to cancel the upload while uploading? Not closing the application I mean but pressing cancel button
the code is like this
thanks.. hope you can help me
I just learnt vb.net not too long ago
I just made application to upload file to website but I have problems
1. How to make progress bar while uploading? I can make progress bar working by pressing a button, but don't know how to do it with uploading..
2. How to cancel the upload while uploading? Not closing the application I mean but pressing cancel button
the code is like this
VB.NET:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
My.Computer.Network.UploadFile("C:\ongoing.txt", "http://localhost/tes/uplot.php")
MessageBox.Show("File uploaded.", "Upload Success")
Catch ex As Exception
MessageBox.Show("Access failed" & vbCrLf & ex.Message)
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Interval = 1
Timer1.Enabled = True
ProgressBar1.Value = 0
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If ProgressBar1.Value < 100 Then
ProgressBar1.Value += 1
Label1.Text = ProgressBar1.Value & " %"
'Me.Label1.BackColor = System.Drawing.Color.Transparent
Else
Timer1.Enabled = False
End If
End Sub
End Class
thanks.. hope you can help me
Last edited by a moderator: