Isn't there a cap on how many images you can download at once? Most
downloader/uploader programs only download/upload 2-8 files at a
time...any more than that is inefficient/eats all your bandwidth, no?
I would like to DL about 8 at a time, and queue the rest...
On Aug 20, 12:40 am, CK <[EMAIL PROTECTED]> wrote:
> Why build a listbox full of the items?
>
> I would write my method for downloading the images, then create a
> delegate with a matching signature. Every time the user enters text
> and clicks the button, call the delegate asynchronously, passing in
> the string. This means each image will be downloaded asynchronously
> with no queuing mechanism required.
>
> On 19 Aug, 23:50, Mark <[EMAIL PROTECTED]> wrote:
>
> > I'm making a Windows Forms Application. It contains a ListView, a
> > TextBox and a Button. The user can type some stuff in the TextBox,
> > click the Button, and it will be added to the ListView. I want to
> > process the items in the ListView and then pop them off list, using a
> > separate thread, so that the program doesn't hang and the user can add
> > more items while it's running. With what I have right now, I can't
> > remove items from the list from a different thread. I understand why
> > this causes problems, but I'm not sure how to fix it. I've tried
> > following a few tutorials to use delegates, but I can't seem to get it
> > to work. Here's what I've got right now:
>
> > using System;
> > using System.Collections.Generic;
> > using System.ComponentModel;
> > using System.Data;
> > using System.Drawing;
> > using System.Text;
> > using System.Windows.Forms;
> > using System.Text.RegularExpressions;
> > using System.Threading;
>
> > namespace ImageDownloader
> > {
> > public partial class Form1 : Form
> > {
> > public Form1()
> > {
> > InitializeComponent();
> > }
>
> > private void Download()
> > {
> > while (true)
> > {
> > if (listView1.Items.Count > 0)
> > {
> > listView1.Items.RemoveAt(0);
> > }
> > }
> > }
>
> > private void button1_Click(object sender, EventArgs e)
> > {
> > listView1.Items.Add(textBox1.Text);
> > textBox1.Text = "";
> > }
>
> > private void Form1_Load(object sender, EventArgs e)
> > {
> > Thread t = new Thread(new ThreadStart(Download));
> > t.Start();
> > }
> > }
>
> > }
>
> > This theoretically should just remove all the items from the list as
> > soon as they are added, one by one. Obviously I'll do some processing
> > on each item first, but I need to get this working before I get into
> > that :)
>
> > Thanks for any help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---