惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
Security Archives - TechRepublic
Security Archives - TechRepublic
NISL@THU
NISL@THU
T
The Exploit Database - CXSecurity.com
T
Threat Research - Cisco Blogs
A
Arctic Wolf
C
Cyber Attacks, Cyber Crime and Cyber Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
Simon Willison's Weblog
Simon Willison's Weblog
V
Visual Studio Blog
T
Tenable Blog
J
Java Code Geeks
C
CERT Recently Published Vulnerability Notes
The Register - Security
The Register - Security
The Cloudflare Blog
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
U
Unit 42
宝玉的分享
宝玉的分享
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
Last Week in AI
Last Week in AI
Forbes - Security
Forbes - Security
I
Intezer
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
Scott Helme
Scott Helme
月光博客
月光博客
Google Online Security Blog
Google Online Security Blog
T
Tailwind CSS Blog
爱范儿
爱范儿
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
LangChain Blog
S
Securelist
Spread Privacy
Spread Privacy
D
Darknet – Hacking Tools, Hacker News & Cyber Security
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
S
Security Affairs
S
SegmentFault 最新的问题
L
Lohrmann on Cybersecurity
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Tor Project blog
博客园 - 聂微东
H
Heimdal Security Blog
B
Blog
Attack and Defense Labs
Attack and Defense Labs

博客园 - KevinWang

在FireFox IE 下Response 中文文件名乱码问题 序列化,反序列化时低序位非打印 ASCII 字符的问题 - KevinWang 月薪上万的人都懂得这些道理 c# .ToString()格式化 利用ListView和DataPager控件来对数据分页 PageMethods Not Found (or Defined)? (转) asp.net中使用ajax中的三种方式 Asp.Net2.0技巧 - KevinWang - 博客园 虚方法(virtual)和抽象方法(abstract)的区别 数据库设计经验之谈(转载) 网站令浏览器崩溃的原因 各种流行的编程风格 2009年海外Web设计风潮 常用js框架,js库 硬盘RAID是什么意思?有什么用? T-SQL和PL/SQL 区别 What is PL/SQL?(PL/SQL是什么,与T-SQL对比) 数据库和数据仓库的区别 ASP.NET MVC 资料
Server.HtmlEncode vs HttpUtility.HtmlEncode
KevinWang · 2011-11-07 · via 博客园 - KevinWang

Server.HtmlEncode is equivalent toSystem.Web.HttpContext.Current.Server.HtmlEncode. The Server Object is an instance of the System.Web.HttpServerUtility class and it is readily accessible through any .aspx page since they inherit from the Page object which in turn has a Server Object instance.

The HttpUtility.HtmlEncode function lives under System.Web.HttpUtility. This class is basically a static version of the Server class which means that you could call the HtmlEncodefunction from a static function or call from another class that does not have an instance of theHttpServerUtility class.

There is a third HtmlEncode function located in the Microsoft’s AntiCross-Site Scripting Library. In contrast with the Server.HtmlEncode and HttpUtility.HtmlEncode functions, the later function takes a more aggressive approach by using a white-list filtering instead of a black-list,hence more PCI standards-compliant, and more secure.

HttpServerUtility.HtmlEncode will use HttpUtility.HtmlEncode internally. There is no specific difference. The reason for existence of Server.HtmlEncode is compatibility with classic ASP.