How to use double quotes in app.config

前端 未结 2 1369
面向向阳花
面向向阳花 2021-01-03 17:38

I need to put double quotes in configuration property Property1

 
相关标签:
2条回答
  • 2021-01-03 18:14

    I believe the proper way to encode quotes in XML is via "

    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.

    0 讨论(0)
  • 2021-01-03 18:34

    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 讨论(0)
提交回复
热议问题