简体   繁体   English

“潜在危险的Request.Form”-获取消息

[英]'A potentially dangerous Request.Form' - get the message

I have a website and someone (every time the same) is trying to send me a message through a textbox (he adds some html code where he shouldn't) and the error is raised. 我有一个网站,有人(每次都一样)正试图通过文本框向我发送消息(他在不应该的地方添加了一些html代码),并且引发了错误。

Unfortunately, all I can get are messages like this one ="...chemistry http://cra..." so it`s no way that I can understand what he try to tell me. 不幸的是,我所能得到的只是像这样的消息=“ ... chemistry http:// cra ...”,所以我无法理解他试图告诉我什么。

My question is: how I can expand that text characters length limit or handle my own error so I can get the whole message? 我的问题是:如何扩展文本字符的长度限制或处理自己的错误,以便获得整个消息?

In your Global.asax, put an Application_Error event handler in to catch all errors that occur, which should include this one. 在您的Global.asax中,放入一个Application_Error事件处理程序,以捕获发生的所有错误,其中应包括此错误。

Sub Application_Error(object sender, EventArgs e)
{
   var ex = Server.GetLastError();
   if (ex != null)
      //Log it
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM