Find in files : FileSystem « Stream File « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net
VB.Net by API
VB.Net Tutorial » Stream File » FileSystem 
13.7.2.Find in files
Option Strict On

Imports Microsoft.VisualBasic.FileIO
Imports System.Collections.ObjectModel

Public Module FileFind
   Public Sub Main()
      Dim filespec() As String = {"*.vb"}
      Dim matches As ReadOnlyCollection(Of String)

      matches = My.Computer.FileSystem.FindInFiles(".""Class", False,SearchOption.SearchTopLevelO
nly, filespec)
      If matches.Count > Then
         Console.WriteLine("'Class' found in:")
         For Each filename As String In matches
            Console.WriteLine(" " & filename)
         Next
      Else
         Console.WriteLine("No matches found.")
      End If
   End Sub
End Module
'Class' found in:
 C:\Java_Dev\WEB\dev\VB\Addaprinterprocess.vb
 C:\Java_Dev\WEB\dev\VB\Addfirstpointandsizetoanotherpoint.vb
13.7.FileSystem
13.7.1.List all available Drives
13.7.2.Find in files
13.7.3.My.Computer.FileSystem.ReadAllText
13.7.4.My.Computer.FileSystem.WriteAllText
13.7.5.My.Computer.FileSystem.CurrentDirectory
13.7.6.Test for a valid directory
13.7.7.My.Computer.FileSystem.DirectoryExists
13.7.8.Drive TotalFreeSpace, AvailableFreeSpace and TotalSize
13.7.9.My.Computer.FileSystem.FileExists(''FileName'')
13.7.10.Use pattern(wildcard) to match directories
13.7.11.Use pattern(wildcard) to match files
13.7.12.My.Computer.FileSystem.FindInFiles
13.7.13.My.Computer.FileSystem.GetParentPath
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.