TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Phlipp Geyer
NA
1
1.5k
Search in directory
Apr 13 2012 8:44 AM
Sorry about my English :)
I search a word from textbox1 in a directory. When i type for example "c" in my textbox1, a listbox shows me all entries that begin with c. (Computer, Control Panel, etc..) What can I do that this listbox shows me all other entries where the letter c is included. (e.g.: abc, helloc,...)
I hope you understand my problem :)
This is my Code:
try
{
string test;
test = textBox1.Text.ToString();
string[] dirs = Directory.GetFiles(@"c:\", test + "*");
foreach (string dir in dirs)
{
listBox2.Items.Add(dir.ToString());
}
}
catch (Exception)
{
}
Thank you, Philipp
EDIT: I've got it :)
string[] dirs = Directory.GetFiles(@"c:\","*" + test + "*");
Reply
Answers (
1
)
Baloontip to piechart
Save a List of objects in another object.