HttpServerUtility.UrlTokenEncode Method

Encodes a byte array into its equivalent string representation using base 64 digits, which is usable for transmission on the URL.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public static string UrlTokenEncode (
	byte[] input
public static String UrlTokenEncode (
	byte[] input
public static function UrlTokenEncode (
	input : byte[]
) : String
Not applicable.



The byte array to encode.

Return Value

The string containing the encoded token if the byte array length is greater than one; otherwise, an empty string ("").

Exception typeCondition


The value of the input parameter is a null reference (Nothing in Visual Basic).

The UrlTokenEncode method converts a byte array into an equivalent string representation encoded with base 64 digits. The resulting string token can be transmitted on the URL.

The UrlTokenEncode will return an empty string if the input parameter has a length of less than one.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions