简体   繁体   中英

C# get item from listbox and search from web

Have a project that im working on in c#(.net). I have a listbox, that a user fills. I need to search for every listbox item online with webclient. So i need a for loop that searches every listbox item online (same link always) individually.

Should the add new item from textbox to listbox add it in an array ? or does it create an array by itself?

Any guidance is much appreciated.

You can iterate through on listbox with a simple for loop, from 0->Items.Count, and add the Item to a new List. I'd rather not write the code :)

I would use List instead of array becouse you don't know how many items you'll have in the ListBox

Or you can just iterate through with for loop and in the for loop call the function for the Item (listBox.Items[i])

I hope it helped.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM