有没有办法在.NET中使用这些字符?.NET转义字符?
我发送一个字符串包含PHP代码通过ajax到.NET方法。
然后,此方法通过电子邮件发送,而是因为他们在jQuery的已经逃脱,它看起来像:
<?php print $test; ?>
Looks like:
%3C%3Fphp%0A%0Aprint%20%24test%3B%0A%0A%3F%3E
所以基本上我需要取消转义它是通过电子邮件发送之前。
编辑
仍然无法得到这个工作,仍然不会发送字段的内容。
public static string CreateSnippet(int processid)
{
//here we find form values posted to the current page
HttpRequest post = HttpContext.Current.Request;
string email = post["email"];
string comment = post["comment"];
string name = post["name"];
string website = post["website"];
var DecodedString = HttpContext.Current.Server.UrlDecode(comment);
var mailcontent = new StringBuilder();
mailcontent.AppendFormat(EmailLineFormat, "Name", name);
mailcontent.AppendFormat(EmailLineFormat, "Email", email);
mailcontent.AppendFormat(EmailLineFormat, "Website", website);
mailcontent.AppendFormat(EmailLineFormat, "Message", DecodedString);
// Send the email
library.SendMail("[email protected]", "[email protected]", "Contact Form Enquiry", mailcontent.ToString(), true);
//if nothing gets created, we return zero
return "success";
}
我是以正确的方式使用它还是存在与我设置变量的方式有关的问题?
感谢 罗伯特
这个称谓使我的突破爆炸。 – Hamish 2012-03-09 00:38:26