Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<?xml version="1.0" encoding="utf-8"?> <Zones> <database>User Id=myuser;Password=mypass;Data Source=xxxxxxx</database> </Zones>
是否可以使用 xmlpoke 和 nant 更新节点值?我的新价值
您可以将整个值设为 NAnt 属性
<property name="db.string" value="User Id=${myID};Password=${myPW};Data Source=${MyDataSource}" />
然后使用xmlpoke命令,例如:
xmlpoke
<xmlpoke file="${YourFilePath}\MyConfig.config" xpath="//Zones/database" value="${db.string}" />
一旦找到该节点,它将更新您在属性中指定的值。注意:未经测试。