我在 Internet 上找到了一个搜索 Word Excel 文本文件中的文件的程序。但是当我修改源代码以在 pdf 文件中搜索时,程序无法执行此操作。我将为您提供用于在 Word 文件中搜索的代码的图像 SO:如何更新此代码以搜索 pdf 文件?
Try
Dim zipPath As String = "Full_Path"
Dim FileContent As String = Nothing
Using zip = ZipFile.Open(zipPath, ZipArchiveMode.Read)
Dim x = zip.GetEntry("word/document.xml")
Dim sr = New StreamReader(x.Open)
FileContent = sr.ReadToEnd
If FileContent.Contains(wf) = True Then FoundStatus = 1 Else FoundStatus = 0
FileContent = Nothing
End Using
Catch ex As Exception
End Try
最良好的问候