使用VB.NET在文件夹中搜索更多文件文本中的字符串 [英] Search a string in folder more file text with VB.NET
本文介绍了使用VB.NET在文件夹中搜索更多文件文本中的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用vb.net搜索文件夹中的字符串更多文件文本
帮助我。
i代码与vb.net,但我不能搜索帮助。
感谢所有会员
< b>我尝试了什么:
a字符串文件夹更多文件文本与vb.net
how to i search a string in folder more file text with vb.net
help me.
i code with vb.net but i dont can search help for it.
thank all member
What I have tried:
a string in folder more file text with vb.net
推荐答案
试试这个: -
Try this:-
Imports System.IO
Module Module1
Sub Main()
Dim path As String = "D:\New folder"
Dim di As New DirectoryInfo(path)
Dim yourSearchString As String
yourSearchString = "to"
Console.WriteLine("Match Found:-")
For Each fi As FileInfo In di.GetFiles()
If File.ReadAllText(fi.FullName).Contains(yourSearchString) Then
Console.WriteLine(fi.Name)
End If
Next
End Sub
End Module
我希望这会对你有帮助..
I hope this will help you..
h elp me。
help me.
i want search AllDirectories. but i dont know how to do.
For Each Dir As String In Directory.GetDirectories(path)
but not word
这篇关于使用VB.NET在文件夹中搜索更多文件文本中的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文