在不受垃圾邮件发送者攻击的情况下,在我的网站上显示电子邮件地址的最佳方式是什么?

And*_*ena 24 html webforms spam-prevention

在不受垃圾邮件发送者攻击的情况下,在我的网站上显示电子邮件地址的最佳方式是什么?

这种方法foo at fooland dot com并不完全符合我的要求.我需要以一种普通人可理解的方式呈现它.

编辑

显示电子邮件是动态的

Gar*_*eth 23

superuser.com上有一个最近的答案,通过比较一系列常用方法来解决这个问题.


Ric*_*ett 7

如何使用具有您的电子邮件地址的简单图像?

动态生成映像的技术可以是使用操作方法将ASP.NET MVC控制器添加到WebForms项目,该方法返回FileResult包含动态生成的包含电子邮件地址的映像.

public class DynamicImageController : System.Web.Mvc.Controller
{
    public FileResult Email(int id)
    {
        // TODO: Code that uses the ID value to retrieve the
        // email address for this customer (for example)
    }
}
Run Code Online (Sandbox Code Playgroud)

在您的Web表单上,您可以使用映像服务器控件,并从后面的代码中设置ImageUrl相应的(类似的东西"/DynamicImage/Email/" + customerId).

此页面有一个示例说明如何使用a FileResult来渲染图像(此场景中的图表)

http://www.codeproject.com/KB/aspnet/MvcChartControlFileResult.aspx

  • 但是,对于任何需要使用该地址的人来说,都有一个麻烦的缺点. (5认同)