配置文件是XML配置文件(配置) config文件中会有像许多条目<name>
abcd
</name>
<company>
xyz
</company>
<choise>
choise1
</choise>
NSIS共有4 XML的插件可供选择NsisXML(由Wizou).xML插件,NsisXML(乔尔)和NSXML 使用NsisXML(由Wizou):Outfile "$%temp%\NSISTest.exe"
RequestExecutionLevel user
Installdir "$Temp"
Showinstdetails show
!include LogicLib.nsh
Page InstFiles
!define XMLFILE "$instdir\myxml.xml"
Section
StrCpy $9 "Did not exist"
nsisXML::create
nsisXML::load "${XMLFILE}"
${If} $0 = 0
build a new basic XML file:
nsisXML::create
nsisXML::createProcessingInstruction "xml" 'version="1.0" encoding="UTF-8" standalone="yes"'
nsisXML::appendChild
nsisXML::release $2
${EndIf}
nsisXML::select '/choise'
${If} $2 = 0
StrCpy $1 $0
nsisXML::createElement "choise"
nsisXML::appendChild
${Else}
nsisXML::getText
StrCpy $9 $3
${EndIf}
DetailPrint "Old value: $9"
System::Call 'kernel32::GetTickCount()i.r5' Get some "random" value to save
nsisXML::setText "$5"
nsisXML::release $2
nsisXML::save "${XMLFILE}"
nsisXML::release $0
DetailPrint "Saved new value: $5"
SectionEnd
在优先次运行我得到:Old value: Did not exist
Saved new value: 709289703
Completed
并在第二次运行我得到:Old value: 709289703
Saved new value: 709308687
Completed
你用DOM把账号节点取出来然后用String中的split方法做切割
就可以放到数组里了
如果单纯是想看账号是不是在这个里面
你也可以直接String.indexof查找读出来的信息中有没有你要的账号
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)