How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview
Go Back  Xtreme Visual Basic Talk > > > How to Recursively search directories using textbox and listview


Reply
 
Thread Tools Display Modes
  #1  
Old 11-25-2013, 11:17 PM
CJacob CJacob is offline
Newcomer
 
Join Date: Nov 2013
Posts: 2
Post How to Recursively search directories using textbox and listview


Can someone help me to make a project that search a file in listview using textbox. I'm using vb.net2010. I want to have a list of all files of a folder and its subfolders files in a listview and can use a textbox to filter the listview. Thanks!
Reply With Quote
  #2  
Old 11-26-2013, 10:06 AM
Gruff's Avatar
GruffHow to Recursively search directories using textbox and listview Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

Hi CJacob. Welcome to the forum. Don't forget to read the forum Posting Guidelines.

You want to start with the System.IO.Directory namespace. Use the imports declaration.
This allows you to access all the folder methods.

GetFiles() is the method you are after. It has several overloads. One of them takes
a SearchPattern argument and an argument that specifies whether to search all sub directories.

The snippet below should give you the idea.
It loads the fully qualified filenames into a standard listbox as an example.

Code:
Imports System.IO Imports System.IO.Directory Public Class Form1 Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim sPath As String = "C:\AAA" Dim sFilter As String = "*.txt" Dim Files() As String = GetFiles(sPath, sFilter, SearchOption.AllDirectories) ListBox1.Items.AddRange(Files) End Sub End Class
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
Reply

Tags
filter listview


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview
 
How to Recursively search directories using textbox and listview
How to Recursively search directories using textbox and listview
 
-->