I am trying to create a pop up progress bar (on a form) that would show
progress from downloading files from an FTP server.
any help will be appreciated 8 4951
In article <E9lab.38516$Cu 3.4173@edtnps84 >, di************* @rivusglobal.co m says... I am trying to create a pop up progress bar (on a form) that would show progress from downloading files from an FTP server.
any help will be appreciated
Put the FTP transfer in a different thread and have it raise events as
it downloads (perhaps raise an event every 8k downloaded). Have your
main form subscribe to this event and update your progress bar.
The key thing here is that the UI update has to be done on the main
thread (the one started by the runtime) since Windows Forms controls are
not thread-safe.
--
Patrick Steele
Microsoft .NET MVP http://weblogs.asp.net/psteele
"Dino M. Buljubasic" <di************ *@rivusglobal.c om> schrieb I am trying to create a pop up progress bar (on a form) that would show progress from downloading files from an FTP server.
any help will be appreciated
Which question do you have? How to download the file? How to show the
progress bar?
--
Armin
Hi Patrick,
I'm fairly new to threading, but I had the impression that events couldn't
(or weren't supposed to) be used between threads -- that only Invoke and
BeginInvoke should be used to pass messages between threads. There's a
discussion of UI/worker threading issues in this article, with sample code
that uses Invoke and BeginInvoke as a clunky workaround: http://msdn.microsoft.com/library/de...et09272002.asp
Am I wrong -- can events safely be used instead?
--Robert Jacobson
"Patrick Steele [MVP]" <pa*****@mvps.o rg> wrote in message
news:MP******** *************** *@msnews.micros oft.com... In article <E9lab.38516$Cu 3.4173@edtnps84 >, di************* @rivusglobal.co m says... I am trying to create a pop up progress bar (on a form) that would show progress from downloading files from an FTP server.
any help will be appreciated
Put the FTP transfer in a different thread and have it raise events as it downloads (perhaps raise an event every 8k downloaded). Have your main form subscribe to this event and update your progress bar.
The key thing here is that the UI update has to be done on the main thread (the one started by the runtime) since Windows Forms controls are not thread-safe.
-- Patrick Steele Microsoft .NET MVP http://weblogs.asp.net/psteele
I don't know how to show progress bar. Actaully, I am showing it now but it
does not refresh.
I have a separate form that holds progress bar. My progress bar is updated
inside a separate thread but only what I manage to update is the forms
title. Any controls inside the form such as the progress bar or labels
displaying name of the file being downloaded, are not refreshed.
"Armin Zingler" <az*******@free net.de> wrote in message
news:ei******** ******@TK2MSFTN GP11.phx.gbl... "Dino M. Buljubasic" <di************ *@rivusglobal.c om> schrieb I am trying to create a pop up progress bar (on a form) that would show progress from downloading files from an FTP server.
any help will be appreciated
Which question do you have? How to download the file? How to show the progress bar?
-- Armin
OK, I understand that. Only one more thing, how to make it reaise event
when it has downloaded 8 or so kb?
I have a sub DownloadFile that downloades file from FTP server, but don't
know how to check for the number of bytes downloaded and then reaise event
while it downloads the bytes.
Thank you for your help
--
Dino Buljubasic
Software Developer http://rivusglobal.com
"Patrick Steele [MVP]" <pa*****@mvps.o rg> wrote in message
news:MP******** *************** *@msnews.micros oft.com... In article <E9lab.38516$Cu 3.4173@edtnps84 >, di************* @rivusglobal.co m says... I am trying to create a pop up progress bar (on a form) that would show progress from downloading files from an FTP server.
any help will be appreciated
Put the FTP transfer in a different thread and have it raise events as it downloads (perhaps raise an event every 8k downloaded). Have your main form subscribe to this event and update your progress bar.
The key thing here is that the UI update has to be done on the main thread (the one started by the runtime) since Windows Forms controls are not thread-safe.
-- Patrick Steele Microsoft .NET MVP http://weblogs.asp.net/psteele
Why don't you use a UserControl, where you'll have the progress bar along
with other label or text.....
"Dino M. Buljubasic" <di************ *@rivusglobal.c om> wrote in message
news:7g******** ************@ne ws2.telusplanet .net... I don't know how to show progress bar. Actaully, I am showing it now but
it does not refresh.
I have a separate form that holds progress bar. My progress bar is
updated inside a separate thread but only what I manage to update is the forms title. Any controls inside the form such as the progress bar or labels displaying name of the file being downloaded, are not refreshed.
"Armin Zingler" <az*******@free net.de> wrote in message news:ei******** ******@TK2MSFTN GP11.phx.gbl... "Dino M. Buljubasic" <di************ *@rivusglobal.c om> schrieb I am trying to create a pop up progress bar (on a form) that would show progress from downloading files from an FTP server.
any help will be appreciated
Which question do you have? How to download the file? How to show the progress bar?
-- Armin
In article <eU************ *@tk2msftngp13. phx.gbl>, rj************* *********@nospa m.com says... I'm fairly new to threading, but I had the impression that events couldn't (or weren't supposed to) be used between threads -- that only Invoke and BeginInvoke should be used to pass messages between threads. There's a discussion of UI/worker threading issues in this article, with sample code that uses Invoke and BeginInvoke as a clunky workaround:
http://msdn.microsoft.com/library/de...et09272002.asp
Am I wrong -- can events safely be used instead?
Actually, with Windows Forms, you always want to use the
Invoke/BeginInvoke to make sure the code runs on the UI thread.
In fact, that is an easire solution to Dino's problem. Simply had a
reference to the ProgressBar in the FTP code and use BeginInvoke to fire
off any updates on the UI thread.
--
Patrick Steele
Microsoft .NET MVP http://weblogs.asp.net/psteele
In article <ml************ ********@news2. telusplanet.net >, di************* @rivusglobal.co m says... OK, I understand that. Only one more thing, how to make it reaise event when it has downloaded 8 or so kb?
I have a sub DownloadFile that downloades file from FTP server, but don't know how to check for the number of bytes downloaded and then reaise event while it downloads the bytes.
If you're downloading the file, you must be in a loop somewhere pulling
the data over the port. In there, keep a counter going and after 8k
comes down, update the progressbar.
Also, from Robert Jacobson's reply, the easiest way to get the
ProgressBar update would be to:
1) Put the FTP code in a differen thread.
2) Make sure the FTP code has a reference to the progessbar
3) Use BeingInvoke on the progress bar to update it from the FTP thread.
--
Patrick Steele
Microsoft .NET MVP http://weblogs.asp.net/psteele This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: John Wells |
last post by:
Guys,
Bruce mentioned I should repost this with Progress in the title. My
friend's company is desperately trying to move from Progress to an open
platform and is seriously considering Postgres as a replacement. If you
have any experience with this and could provide a performance comparison,
I'd really appreciate it. Thanks!
Here's the original post:
|
by: Adam |
last post by:
I've posted about this previously, but failed to receive
a satisfactory response, so have included a code sample:
I am trying to receive messages from an HTML viewer
control in compact.net (c#), but cannot use message
window as the control's parent window, as this is
invisible and so the html is not viewable!
I have a code sample showing the problem at
www.tenwisevirgins.com/Example.zip
|
by: Steve McLellan |
last post by:
Hi,
Sorry to repost, but this is becoming aggravating, and causing me a lot of
wasted time. I've got a reasonably large mixed C++ project, and after a
number of builds (but not a constant number) linking (and sometimes
compiling) becomes immensely slow, and task manager shows that link.exe (or
cl.exe) is barely using any processor time, but an awful lot of RAM (around
150-200MB). I'm going to keep an eye on page faults since I can't...
|
by: SpamProof |
last post by:
I got an animated gif that is a barber pole spinning that I want to
use as a progress bar.
The problem is that is stops spinning (shows 1 frame) when my browser
is processing a submited request that might take 5-8 seconds.
I tried to putting the gif in a sepearate page and referencing it
using iframe thinking that if the gif is on another page & calling it
from my main page, it would not be affected by my submittals and
continue to...
|
by: Pepi Tonas |
last post by:
I have a form that takes some time to load because it has to populate
some Data. I was trying to display a form on top of it with an
activity bar so that user can see that something's going on.
I have tried doing this and using a progress bar that counts up to 100
and then zeros down so that it should be constantly moving while the
main or background windows finishes loading.
The problem is that the "in progress window" doesn't display...
| |
by: Raj |
last post by:
Hi,
I have the following problem. I am displaying and printing a PDF file
that is generated by my Application server. The print dialogs comes up
correctly for the small PDF for the larger PDFs ,the print dialog for
the Acrobat reader does not comes up. I believe this is because print
method is called before the complete loading of the PDF document.
<html>
<Head>
<script>
|
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 click. The
handler's process request routine reads the status of the progress by
querying the...
|
by: eladla |
last post by:
Hi!
I am creating a composite control the does some of it`s own data access.
I want to display a progress bar between the time the page is loaded and the
control place holder is displayed and final display of the data from the
database.
I was thinking of manually opening a second thread in the Render method, but
nothing is displayed before the render method exits anyway.
Anyone know of a good way to do this?
I have been working on this...
|
by: jags_32 |
last post by:
Hello
We use MFG-PRO as our ERP system which in turn uses Progress
databases. In the old version of SQL 2000, using DTS packages, we used
to set the code page via command prompts and execute DTS packages
within that command prompt to fetch data from our double byte ERP
databases. In SSIS, we are able to connect and fecth data from NON
Double Byte databases, however, when we set the code page first and
execute via a command prompt the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |