如何逃避& aspx页面 [英] How to escape & aspx page
本文介绍了如何逃避& aspx页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< system.net>
< mailSettings>
< smtp>
< network host =mail.gov.orgport =2525userName =username@gov.orgpassword =me4& irene/>
&是一个特殊的角色,它创造了一个错误。
我想要一种方法来逃避它但仍然包含它作为密码的一部分
我的尝试:
< system.net>
< mailSettings>
< smtp>
< network host =mail.gov.orgport =2525userName =username@gov.orgpassword =me4& irene/>
解决方案
web.config
文件是一个XML文件。您需要使用该字符的正确XML表示形式:& amp;
< network 主机 = mail.gov.org port = 2525 userName = username@gov.org 密码 = me4& amp; irene / >
<system.net> <mailSettings> <smtp> <network host ="mail.gov.org" port="2525" userName="username@gov.org" password="me4&irene"/>
the & is a special character and its creating an error.
I want a way to escape it but still include it as part of the password
What I have tried:
<system.net> <mailSettings> <smtp> <network host ="mail.gov.org" port="2525" userName="username@gov.org" password="me4&irene"/>
解决方案
Theweb.config
file is an XML file. You need to use the correct XML representation of the character:&
<network host="mail.gov.org" port="2525" userName="username@gov.org" password="me4&irene"/>
List of XML and HTML character entity references - Wikipedia[^]
这篇关于如何逃避& aspx页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文