[英]appcmd set config appSettings - value with plus (+) is being converting to space
我正在尝试使用appcmd在web.config中设置appSetting,appSetting的值包含一个+符号。 当我运行appcmd时,会创建appSetting,但+会转换为空格。
appcmd我正在运行:
"C:\system32\inetsrv\appcmd.exe" set config "Default Web Site" /section:appSettings /+"[key='Test',value='++ ++']"
创建的appSetting:
<add key="Test" value=" " />
我尝试在appcmd中使用%2b而不是+,这不起作用(它在appSetting中转换为'b'。
有没有人知道如何在使用appcmd时在appSetting中包含+符号?
您是否尝试过使用+ %u002b
的unicode值?
"C:\system32\inetsrv\appcmd.exe" set config "Default Web Site" /section:appSettings
/+"[key='Test',value='%%u002b']"
您需要添加额外的%符号才能转义unicode值中的%。
这应该导致Test键的值为+。
看到:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.