https://stackoverflow.com/questions/14607920/the-character-breaks-passwords-that-are-stored-in-the-web-config

答案一

I suspect that you didn't encode the password properly in the web.config file. Remember that web.config is a XML file, so entities must be encoded.

Instead of

my&password 

try

my&password

You can use sites such as FreeFormatter.com to escape/unescape XML strings.

答案二

< = &lt;
> = &gt;
" = &quot;
' = &apos;
& = &amp;

方案三

XML Escape / Unescape

Escapes or unescapes an XML file removing traces of offending characters that could be wrongfully interpreted as markup.

The following characters are reserved in XML and must be replaced with their corresponding XML entities:

  • ' is replaced with &apos;
  • " is replaced with &quot;
  • & is replaced with &amp;
  • < is replaced with &lt;
  • > is replaced with &gt;

xml配置文件中的转义字符的更多相关文章

  1. mybatis 中的 xml 配置文件中 ‘<’、 ‘>’ 处理

    mybatis 中的 xml 配置文件中 '<'. '>' 处理 1.使用转义字符将 '<'. '>' 替换掉. 描述 字符 转义字符 小于号 < < 大于号 &g ...

  2. 关于Android中res目录strings.xml文件中的转义字符之笔录

    res目录strings.xml文件中的转义字符:         ------------------>     代表着一个汉字的位置:                        ---- ...

  3. @Required 注释应用于 bean 属性的 setter 方法,它表明受影响的 bean 属性在配置时必须放在 XML 配置文件中,否则容器就会抛出一个 BeanInitializationException 异常。

    @Required 注释应用于 bean 属性的 setter 方法,它表明受影响的 bean 属性在配置时必须放在 XML 配置文件中,否则容器就会抛出一个 BeanInitializationEx ...

  4. 通过java程序调用ant build.xml配置文件中指定的target

    一.概述 通过ant实现项目的自动化部署,jar包生成,替换,tomcat关停.启动,查看项目日志: 通过java程序调用已编辑好的ant脚本build.xml配置文件中指定的target: 文中文件 ...

  5. Spring的xml配置文件中约束的必要性 找不到元素 'beans' 的声明

    今天在复习Spring MVC框架的时候,只知道xml配置文件中的约束有规范书写格式的作用,所以在配置HandlerMapping对象信息的时候没有加入约束信息之后进行测试,没有遇到问题.后来在配置S ...

  6. web.xml配置文件中<async-supported>true</async-supported>报错

    web.xml配置文件中<async-supported>true</async-supported>报错 http://blog.csdn.net/dream_ll/arti ...

  7. 将应用程序中的一些参数写到xml配置文件中

    最近碰到一个问题,需要将程序中的一些基本参数写到xml文件中,虽然网上有好多现成的代码,但是觉得对xml不熟悉,果断就研究了一下.先说一下大体思路吧,我设计了一个用来读取和回填的类,然后定义了一个接口 ...

  8. tomcat设置默认欢迎页、server.xml配置文件中的标签理解

    一:要求:输入网址,不加文件名便可以访问默认页面 (1)项目中只有静态文件 方法:更改tomcat下的conf目录下的web.xml文件,如下图: <welcom-file-list>元素 ...

  9. SqlMapConfig.xml配置文件中的properties属性

    1.原始的SqlMapConfig.xml配置文件的内容为: <?xml version="1.0" encoding="UTF-8" ?> < ...

随机推荐

  1. C# 多线程系列(二)

    传递数据给一个线程 通过函数或lambda表达式包一层进行传递. static void Main(string[] args) { Thread thread = new Thread(() =&g ...

  2. javascript执行环境及作用域

    执行环境(execution context,为简单起见,有时也成为“环境”)是javascript中最为重要的一个概念.执行环境定义了变量或函数有权访问的其他数据,决定了它们各自的行为.每个执行环境 ...

  3. for 循环 乘法口诀表

    用for循环写乘法口诀表: for(var i = 1; i <= 9; i++) { var c=''; for(var x = 1; x <= i; x++) {    c=c+x+' ...

  4. ★Java语法(六)——————————分支语句

    1. if 语句   格式用法: if(布尔表达式) { 语句: } 2. if……else  语句 格式用法: if(表达式) { 语句1: } else { 语句2: } 3.if……else i ...

  5. MxNet教程:使用一台机器训练1400万张图片

    官网链接:http://mxnet.readthedocs.io/en/latest/tutorials/imagenet_full.html Training Deep Net on 14 Mill ...

  6. c#如何用代码开启cmd指定命令(如:运行一个手机adb shell命令)

    else if (this.Mode == TravelMode.AutoRecodeMode) { DateTime StartDate = DateTime.Now; string args = ...

  7. eclipse快捷键:

    打开快捷键提示: ctrl + shift + L; 自动补全代码: Alt + /; 快速修复: ctrl + 1; 导包: ctrl + shift + o; 格式化代码: ctrl + shif ...

  8. (转)C#开发微信门户及应用(4)--关注用户列表及详细信息管理

    http://www.cnblogs.com/wuhuacong/p/3695213.html 在上个月的对C#开发微信门户及应用做了介绍,写过了几篇的随笔进行分享,由于时间关系,间隔了一段时间没有继 ...

  9. String类练习统计一个字符串中大小写字母及数字字符个数

    public class StringPractice { public static void main(String[] args) { //创建一个文本扫描器 Scanner sc = new ...

  10. eas之视图冻结与解冻

    // 冻结视图 table.getViewManager().freeze(verticalIndex, horizonIndex); //冻结视图:该方法在table还没显示的时候使用,也就是该方法 ...