System.Web.HttpUtility VS System.Net.WebUtility

Source: Internet
Author: User

Https//msdn.microsoft.com/en-us/library/ee388354 (v=vs.110). aspxHttps//msdn.microsoft.com/en-us/library/system.web.httputility (v=vs.110). aspx(1System.Web.HttpUtility The URL encoding decoding method when making a WEB request, cannot be inherited note: This class is httpserverutility built-in. However, the HttpUtility class contains the encoding and decoding methods, and Server object cannot be used. Codecs outside the Web application, using the Webutility class. (2System.Net.WebUtility provides a way to encode and decode URLs when making Web requests note: HttpUtility contains a method for encoding and decoding HTML-encoded strings, The System.Uri class also contains methods and properties for the same purpose System.Net.WebUtility.HtmlDecode decode the HTML-encoded string for HTTP transmission Note: If the word such as spaces and punctuation are passed in the HTTP stream, They may be incorrectly decoded at the end of the receive. HTML encoding transforms those characters that are not allowed in HTML literal equivalent character entities; HTML decoding and encoding reverse. For example, when a block of text is built in, the character< and > are encoded into &lt; and &gt; for HTTP transmission. If the parameter value is NULL, the decoding returns NULL, and if the value is NULL, the decoding is empty. System.Net.WebUtility.UrlDecode decoding a string encoded in a URL by transmission note: If the word such as spaces and punctuation are passed in the HTTP stream, they may be decoded at the end of the receive. The URL encoding translates the literal equivalent of the 16 binary escape sequences that are not allowed in the URLs; UrlEncode generates a URL-encoded string. URL decoding replaces hexadecimal escape sequences with corresponding ASCII characters, for example, URL-encoded blocks, escape sequences%3C and%3e are decoded into < and >.

System.Web.HttpUtility VS System.Net.WebUtility

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.