2
Answers

one of the listbox data is transfer to another listbox

ajay raju

ajay raju

14y
3.9k
1

hi!
i take Two list boxes. and two buttons one for Add Items and another for Remove Items.
by default items is displayed in Listbox1 and i select items (one or more) and click Add items button that selected items are added into the Listbox2 . And i select items into the Listbox2, and i click Remove Items button That selected items are Removed from Listbox2.
Please Give a code for this
Thanks. 
Answers (2)
1
Sameer Shaik

Sameer Shaik

NA 953 1k 7y
Here is the sample code (not tested)
 
//Get all config files from directory 
string[] files = Directory.GetFiles (sourceDirectory, "*.config")
loop through each file, 
Read file line by line 
 
var fileStream = new FileStream(@"c:\file.config", FileMode.Open, FileAccess.Read);
using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
{
string line;
while ((line = streamReader.ReadLine()) != null)
{
// process the line
if(line.contains("endpoint"))
{
//process ur end point here
}
}
}
 
0
Chitra

Chitra

NA 7 240 7y
Thanks Sameer, but can you please help me with the code.
0
Sameer Shaik

Sameer Shaik

NA 953 1k 7y
first you need to find/prepare regular expression for endpoint string format.
Later you can read text of each file and find the matching text