WebUtility Class

WebUtility Class

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Provides methods for encoding and decoding URLs when processing Web requests.

System.Object
  System.Net.WebUtility

Namespace:  System.Net
Assembly:  System (in System.dll)

public static class WebUtility

The WebUtility type exposes the following members.

  NameDescription
Public methodStatic memberHtmlDecodeConverts a string that has been HTML-encoded for HTTP transmission into a decoded string.
Public methodStatic memberHtmlEncodeConverts a string to an HTML-encoded string.
Public methodStatic memberUrlDecodeConverts a string that has been encoded for transmission in a URL into a decoded string.
Public methodStatic memberUrlDecodeToBytesConverts a URL-encoded byte array into a decoded string using the specified encoding object, starting at the specified position in the array, and continuing for the specified number of bytes.
Public methodStatic memberUrlEncodeEncodes a URL string.
Public methodStatic memberUrlEncodeToBytesConverts a byte array into a URL-encoded string, starting at the specified position in the array and continuing for the specified number of bytes.
Top

The HttpUtility class contains encoding and decoding utility methods for use with HTML-encode strings. The System.Uri class also contains methods and properties that can be used for similar purposes.

Capabilities

If you use this API in your app, you must specify the following capabilities in the app manifest. Otherwise, your app might not work correctly or it might exit unexpectedly.

ID_CAP_NETWORKING

Windows Phone 8, Windows Phone OS 7.1

For more info, see App capabilities and hardware requirements for Windows Phone 8.

Windows Phone OS

Supported in: 8.1, 8.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Show:
© 2016 Microsoft