Click or drag to resize
ConvertToBase64String Method (Byte, Int32, Int32, Base64FormattingOptions)
Converts a subset of an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 digits. Parameters specify the subset as an offset in the input array, the number of elements in the array to convert, and whether to insert line breaks in the return value.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static string ToBase64String(
	byte[] inArray,
	int offset,
	int length,
	Base64FormattingOptions options
)

Parameters

inArray
Type: SystemByte
An array of 8-bit unsigned integers.
offset
Type: SystemInt32
An offset in inArray.
length
Type: SystemInt32
The number of elements of inArray to convert.
options
Type: SystemBase64FormattingOptions
InsertLineBreaks to insert a line break every 76 characters, or None to not insert line breaks.

Return Value

Type: String
The string representation in base 64 of length elements of inArray, starting at position offset.
Exceptions
ExceptionCondition
ArgumentNullExceptioninArray is null.
ArgumentOutOfRangeExceptionoffset or length is negative.-or- offset plus length is greater than the length of inArray.
ArgumentExceptionoptions is not a valid Base64FormattingOptions value.
See Also