el.severo
el.severo

Reputation: 2287

email address obfuscate .net asp

Does anyone knows a .net alternative for obfuscation like this way?

as an output I'd like to be something like:

<A HREF="mailto:
&#121;&#111;&#117;&#114;&#110;&#097;&#109;&#101;&#064;&#100;&#111;&#109;&#097;&#105;&#110;&#046;&#099;&#111;&#109;">
&#121;&#111;&#117;&#114;&#110;&#097;&#109;&#101;&#064;&#100;&#111;&#109;&#097;&#105;&#110;&#046;&#099;&#111;&#109;
</A>"

Upvotes: 1

Views: 1308

Answers (1)

Guffa
Guffa

Reputation: 700720

You can encode a string like that using:

email =
  String.Concat(email.Select(c => "&#" + ((int)c).ToString() + ";").ToArray());

Upvotes: 4

Related Questions