Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

c# / Combining one keyword with password list

I want it to do this

First listbox (or textbox): red
Second listbox (no textbox): 1234
minecraft
batman
password123

then the outcome

red:1234
red:minecraft
red:batman
red:password123

I figured out to combine two listboxes that have the same amount of items in item in it, but I need it to be able to combine 1 into several like above. Thanks.

BTC:1GZ3Q59QTm9RtzGtby9Rcmw7vtm9d7BME6
AIOHNB have this feature, just use that.
(May 30, 2015 01:19 PM)SIM-2193483 Wrote:  AIOHNB have this feature, just use that.

well yes I know that, I'm wanting to code myself one to teach myself c#

BTC:1GZ3Q59QTm9RtzGtby9Rcmw7vtm9d7BME6
Oh just realized that this is in the C# section, cant help you with that I think sorry
just check if the other listbox item is not nothing and combine
I've dealt with this exact question before. Give me a minute so I can find my answer.

Edit- found it:
Code
listBox1.Items.AddRange(input.SelectMany(u => input, (u, p) => string.Join(':', u, p)).ToArray())

Assuming input is a collection.
Something like this?

Code
foreach(string s in listBox1.Items)
{
    listBox2.Items.Add(textBox1.Text + ":" + s);
}
Thanks guys for the help i got it working ^.^

BTC:1GZ3Q59QTm9RtzGtby9Rcmw7vtm9d7BME6


Possibly Related Threads...
Thread / Author Replies Views Last Post
by greekdevSep 9, 2026 10:36 AM 2 126 Sep 9, 2026 10:36 AM
Last Post: greekdev
[Java] by Nemo2478Jun 12, 2020 01:59 AM 4 141 Jun 12, 2020 01:59 AM
Last Post: Nemo2478
[Python] by Ineed2learn2eatJul 13, 2017 10:48 AM 3 230 Jul 13, 2017 10:48 AM
Last Post: Ineed2learn2eat