是否可以在app.config键值中包含超链接? [英] Is it possible to include hyperlink in app.config key value?

查看:65
本文介绍了是否可以在app.config键值中包含超链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将超链接作为文本的一部分包含在app.config键值对中(将电子邮件正文文本作为值)?我想从app.config键值生成电子邮件正文.

Is it possible to include hyperlink as a part of text in app.config key value pair (email body text as value)? I want to generate email body from app.config key value.

例如:

<add key="EmailBody" value="Email body goes here with <a href="some link">click here</a> hyperlink/>

我知道这是无效的,但是有办法实现吗?

I know this is not valid, but is there a way to achieve this?

提前谢谢!

推荐答案

我这样做的方法是如图所示编写您的电子邮件正文,但实际上不添加等.相反,请执行以下操作:

The way i would do it is write your email body as shown but do not actually add the etc. Instead, do something like the following :

<add key="EmailBody" value="Email body goes here with &&&www.google.com!!!click here£££>

然后,在访问/处理此密钥的代码侧,替换&&&与:

Then, on the code side that is accessing / handling this key, replace &&& with :

<a href="

替换!!!与:

">

将£££替换为:

</a>

这只是一个示例,但是让您对如何避免在属性中没有标签的事实有所了解.

This is just an example, but gives you a little idea on how to get around the fact you cant have tags in attributes.

希望这会有所帮助.

这篇关于是否可以在app.config键值中包含超链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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