开发者

How to use double quotes in app.config

I need to put double quotes in configuration property Property1

 <Se开发者_开发技巧ection Name Propety1="" .../>


I believe the proper way to encode quotes in XML is via &quot;

See this answer: How do I escape double quotes in attributes in an XML String in T-SQL?

The same would go for any other 'special' characters you wish to include as data. Essentially, you should use the same encoding you would use in HTML attributes.


You could html encode the value when you add it to the configuration file. This should ensure any special character will be handled correctly in the xml and be returned as expected.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜