473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Search Files on hardrive

I am using this code to get files, but I can not get it to search for all files on C: drive.
How can I get it to show all files Like *.pdf of the drive in the list box

Expand|Select|Wrap|Line Numbers
  1. Imports System.IO
  2. Imports System
  3. Imports System.Drawing
  4. Imports System.Windows.Forms
  5.  
  6. Public Class SearchAvi
  7.  
  8.     Private Sub BtnGetAviFiles_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnGetAviFiles.Click
  9.  
  10.         Dim dir1 As New IO.DirectoryInfo("c:")
  11.         Dim dir2 As IO.FileInfo() = dir1.GetFiles()
  12.         Dim files1 As IO.FileInfo
  13.  
  14.         For Each files1 In dir2
  15.             FrmListBox.Items.Add(files1)
  16.         Next
  17.  
  18.     End Sub
  19.  
Jul 29 '11 #1
0 965

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: mm | last post by:
Can someone with Win 2K please help me here. Best yet, can some MVP duplicate it and report it to MS. I can't find any reference to this issue on the Web, or in MS Knowledge Base. I have been...
60
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't...
5
by: Brian W | last post by:
I know I've seen this problem before but I'll be damned if I can remember how to fix it. When I use Windows to search for files of type *.cs (or *.*) containing "sometext" Windows doesn't return...
5
by: Jim | last post by:
Hello, I am working on a small windows application for a client, and as one of the functions they want a search that will let them enter a search string, then search a directory for all flies...
5
by: Dhans | last post by:
Framework version : 1.1 For a given directory (which may have subdirectories), I need to identify the number of text files (*.txt). For this I have tried recursive method to search files, it...
3
by: Chung Leong | last post by:
Here's the rest of the tutorial I started earlier: Aside from text within a document, Indexing Service let you search on meta information stored in the files. For example, MusicArtist and...
1
by: Rups | last post by:
API FindFirstFile searches for files based on long and short names(8+3). If i need to search files based on long names only . How can i do ?Is there any other API which does search based on long...
0
by: SteveA | last post by:
I'm using Visual C# 2005 version 2.0.50727. When I use the "Find In Files" command to search for text in my "Entire Solution", nothing appears in the Find Results window. This was working until...
5
by: Sarahger9 | last post by:
Hi, I'm working on a project that searches one file for words and their replacements found in another file. I'm stuck at the beginning. I think, I need to put the words in the file in an array so I...
10
sagacious
by: sagacious | last post by:
Hi There.. Nice Site.. I Want to add a File Search Engine For My Upload And Download Site.. As Like As Rapidshare Search Engins.. I Mean A Search System That Will Search Files From A...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.