使用安全的HTML编码函数解决XSS攻击

https://www.sohu.com/a/229034179_100158559

https://blog.csdn.net/mgxcool/article/details/73028502

对url链接进行转义

public String htmlEncode(String str)
{
return Server.HtmlEncode(str);
}

上述我这边用的无效,后来采用了url写死的方式,阻止攻击。

posted @ 2023-07-25 19:03  yinghualeihenmei  阅读(36)  评论(0编辑  收藏  举报