最新消息:

读写xml范例

nsis 永恒心锁 1436浏览 0评论
Outfile "NSISTest.exe"
RequestExecutionLevel user
Installdir "$exedir"
Showinstdetails show
!include LogicLib.nsh
Page InstFiles
!define XMLFILE "$instdirmyxml.xml"
Section
StrCpy $9 "不存在"
nsisXML::create
nsisXML::load "${XMLFILE}"
${If} $0 = 0
 ;创建一个新XML文件
 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 "旧值: $9"
System::Call 'kernel32::GetTickCount()i.r5' ;获取一些“随机”的值
nsisXML::setText "$5"
nsisXML::release $2
nsisXML::save "${XMLFILE}"
nsisXML::release $0
DetailPrint "保存新值: $5"
SectionEnd
永恒心锁,版权所有丨如未注明,均为转载丨本网站采用BY-NC-SA协议进行授权

转载请注明:永恒心锁-分享互联网 » 读写xml范例

您必须 登录 才能发表评论!