如何在 global.asax 中实现防伪令牌?

How to implement antoforgery token in global.asax?

为了防止 CSRF 攻击,需要在我们的项目中为 asp.net 网站(不适用于 MVC)实施防伪令牌。我们无法在 google 中找到它。如果我们在 global.asax 中实现它会更好。请帮忙。提前致谢。

您使用的是哪个版本的 .net?某些版本将它内置到母版页中,否则如果您需要查看它在 webforms 项目中的外观,您可以检查: https://software-security.sans.org/developer-how-to/developer-guide-csrf