473,545 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

progress bar - what am I missing?

this code came from cor and I think Armin authored it.

I am trying to download an access database and track its progress.

It is reading the size fo the file but I am unsure of how to get the data
there. It is not actually writing anything.

Any ideas anyone?

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
ipserver = "xx.xx.xx.x x"

m_Thread = New MyThread
AddHandler m_Thread.Progre ss, AddressOf OnProgress
AddHandler m_Thread.Done, AddressOf OnDone
m_Thread.Start( )

End Sub

Public Delegate Sub ProgressDelegat e(ByVal Progress As Integer)

Private Sub OnProgress(ByVa l Progress As Integer)
If Me.InvokeRequir ed Then
Me.Invoke(New ProgressDelegat e( _
AddressOf OnProgress _
), New Object() {Progress})
Else
Me.Button1.Text = Progress.ToStri ng
ProgressBar1.In crement(1)
End If
End Sub

Private Sub OnDone()
m_Thread = Nothing
End Sub
Class MyThread
Public Event Progress(ByVal Progress As Integer)
Public Event Done()

Private m_Thread As Thread

Public Sub Start()
m_Thread = New Thread(AddressO f ThreadStart)
m_Thread.Start( )
End Sub

Private Sub ThreadStart()
Dim i As Integer

With keywordwebreque st.GetRequestSt ream
For i = 1 To keywordresponse size / 50000
'(keywordwebreq uest.GetRequest Stream.Write
Thread.Sleep(10 0)
RaiseEvent Progress(i)
Next

End With
RaiseEvent Done()
End Sub

End Class
Nov 20 '05 #1
1 1636
solved it myself thanks anyway.......
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4115
by: Andrew Godwin | last post by:
I'm trying to write a python script to download data (well, files) from a HTTP server (well, a PHP script spitting them out, at least). The file data is just the returned data from the request (the server script echoes the file and then dies). I call the page using urllib2, like so: satelliteRequest = urllib2.Request(satelliteServer +...
2
1623
by: Howard | last post by:
I wrote a program that downloads rar files off my ftp server using TCP client. I would like to display a progress bar that advances while downloading the files. I tried that, but the program freezes while it's downloading and the progress bar is not responding as well. I've read articles on MSDN and google, but wasn't successful at doing it....
0
1330
by: David Gosche | last post by:
I have a form which is calling the DTS process and then a separate class which handles the DTS events. I want the DTS event OnProgress to update a ProgressBar on the Form. Does anyone know how I can do this? I've tried passing the progress bar object to the class that handles the DTS events but seems to create a new ProgressBar object. ...
0
1465
by: Joel Cade | last post by:
I'd just like a sanity check on my thinking. I'm attempting to create a progress bar for a file upload to an ASPX page. I'm adding an HTTP Module, which would then call into a "Progress Handler", a remoting object created as a singleton object, which would keep track of all file uploads by an id. Does this make sense? I haven't seen this...
6
2130
by: Ernie | last post by:
I have a unique issue... We are using Microsoft Commerce Server and Content Manager on our eCommerce Site. I have been requested to display a login status (Pic that says Please Wait) in a control that is located on multiple pages. Therefore I need to embed a code segment to be executed when a specific button is pressed to display the "Please...
3
1926
by: WB | last post by:
Hi, I'm building my first Windows application using C#. My Windows application sends newsletter to our subscribers by email. Our newsletter is sort of "customized" so my application has to build the newsletter for each individual subscriber before sending it out. Now the whole newsletter sending process to all the subscribers is a very...
1
4104
by: daniel_xi | last post by:
Hi all, I am running a VS 2003 .NET project on my client machine (Win 2000 SP4, ..NET framework 1.1), running an ASP.NET application on a remote web server (Win 2000 Server, IIS 6.0, .NET framework 1.1). The application implements a Progress Bar webcontrol, that pops up in a window, using the HttpHandler interface, on the event of a button...
3
3446
by: Tim Satterwhite | last post by:
Hi All, I think this is a thorny problem, and I'm hoping you can help. I've not found this exact issue described anywhere yet. I have a stored procedure that calls BULK INSERT on a set of text files. These files are FTP'd from a legacy system (a mainframe running MVS). Sometimes, the process steps on iteslf, whereby the bulk insert is...
2
4220
by: bryangrif | last post by:
I am attempting to connect a progress bar to my application. I have created a separate form that has a label and a progress bar. I am making a call to CopyFileEx via interop to copy files over a network and would like to use the callback function to update the progress bar on the form. This application is written in C# with VS 2005. Any...
0
7391
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7746
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5962
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5320
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4941
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3438
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1869
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.