如何在app.config中添加换行符? [英] How to add newline character in app.config?

查看:92
本文介绍了如何在app.config中添加换行符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太了解如何在包含两行或更多行的app.config中编写消息.我通常在配置文件中的代码是:

I'm not getting as how to write a message in app.config which consists of two or more lines. My usual code in config file is :

add key="msg_test" value="This is test message."       

我用c清晰的代码(如

ConfigurationSettings.AppSettings[msg_test];

我想写类似

add key="msg_test" 
    value="This is test message \n are you sure you want to continue?"

推荐答案

您可以在值中使用换行符:

You can just use line breaks in the value:

add key="msg_test" value="This is
test message."

您还可以使用XML编码的字符:

You can also use XML encoded characters:

add key="msg_test" value="This is
test message."

(我已经测试了它们,并且它们都可以工作.)

(I have tested both, and they work.)

这篇关于如何在app.config中添加换行符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆