Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21100

Find a word in text file

$
0
0
hi
How find word in Ini file?!
i want find a word in a ini file and if exist my word then: show msgbox"Find" and if not exist my word then msgbox"Not Find"
How do this work?

my File is Ini File.

i test this code:

Code:


i = FreeFile
Open "C:\Boot.ini" For Input As #i
temp = StrConv(InputB(LOF(i), i), vbUnicode)
Close #i
If InStr(1, temp, "Example", vbTextCompare) Then
    MsgBox "Yes"
    Else
MsgBox "No"
End If


But This Code Just Work on Text(txt) Files! and not Work In INI File!

Viewing all articles
Browse latest Browse all 21100

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>