Click or drag to resize
EncodingGetBytes Method (String)
When overridden in a derived class, encodes all the characters in the specified string into a sequence of bytes.

Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public virtual byte[] GetBytes(
	string s
)

Parameters

s
Type: SystemString
The string containing the characters to encode.

Return Value

Type: Byte
A byte array containing the results of encoding the specified set of characters.
Exceptions
ExceptionCondition
ArgumentNullExceptions is null.
EncoderFallbackExceptionA fallback occurred (see Character Encoding in the .NET Framework for complete explanation)-and-EncoderFallback is set to EncoderExceptionFallback.
See Also