e.g. If you intend to add :-
<add key="MyPassword" value="pass<word&2003"/>
Replace it with below :-
<add key="MyPassword" value="pass<word&2003"/>
具体而言:-
& needs to be encoded as &
< needs to be encoded as <
> needs to be encoded as >
" needs to be encoded as "
' needs to be encoded as '
2条答案
按热度按时间jgzswidk1#
通过使用
&
代替&
来转义&符号作为一个FYI,看到这里为进一步的字符:What characters do I need to escape in XML documents?
hs1rzwqc2#
配置文件是XML文件。属性值需要为XML正确编码。
具体而言:-