我想设置值appconfig键,但值包含&character.I尝试双&&像这样的“8L && L26X0s8 @ P”但是不工作。可以帮助我吗?
<add key="SAP_PASS" value="8L&L26X0s8@P"/>
As app.config
is xml
file, use XML
entities for this.
Specifically &
is coded as &
(including the semicolon) in XML
.
have you tried &
? This is the usual escape
您可以使用Regex.Escape(字符串)转义任何字符
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.