UrlTokenEncode Method

HttpServerUtility.UrlTokenEncode Method

Note: This method is new in the .NET Framework version 2.0.

Encodes a byte array into its equivalent string representation using base 64 digits and suitable for transmission on the URL.

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

Public Shared Function UrlTokenEncode ( _
	input As Byte() _
) As String
Dim input As Byte()
Dim returnValue As String

returnValue = HttpServerUtility.UrlTokenEncode(input)
public static String UrlTokenEncode (
	byte[] input
public static function UrlTokenEncode (
	input : byte[]
) : String



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 input 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 byte array has a length of less than one.

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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

© 2015 Microsoft