NSIS查找文本中是否包含某个字串

2022-11-05,,,,

!include "textfunc.nsh"
!include "logiclib.nsh"
OutFile "find.exe"
#文本文件a.txt内其中一行包含字串kb234783
#编写 水晶石
#查找文本中是否包含某个字串

Var found

Section
  StrCpy $found 0
    ${LineFind} "a.txt" "/NUL" "1:-1" "GrepFunc"
    ${if} $found = 1
          MessageBox MB_OK "找到了"
    ${else}
          MessageBox MB_OK "没找到"
    ${endIf}
SectionEnd

Function GrepFunc
    ${TrimNewLines} '$R9' $R9
    System::Call "Shlwapi::StrStr(tR9, t`kb234783`)i .r0"
    ${if} $0 != 0
         StrCpy $found 1
         Push "StopLineFind"
    ${else}
         Push 0
   ${endIf}
FunctionEnd

NSIS查找文本中是否包含某个字串的相关教程结束。

《NSIS查找文本中是否包含某个字串.doc》

下载本文的Word格式文档,以方便收藏与打印。