NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

String.ToByte

Converts a string to a value in the specified base, represented as an 8-bit unsigned Byte.

[Visual Basic]
Overridable Public Function ToByte() As Byte
[C#]
public virtual byte ToByte();
[C++]
public: virtual unsigned char ToByte();
[JScript]
public function ToByte() : Byte;

Return Value

The unsigned byte representation of the string as a base number.

Exceptions

Exception Type Condition
ArgumentException If the string is not base 2, 8, 10, or 16.
FormatException If the string cannot be parsed as a base number.
ArgumentNullException If the string is null.
OverflowException If the string is greater than Byte.MaxValue or less than Byte.MinValue.

Remarks

If the number is 16, the number may be preceded by "0x"; any other leading or trailing character causes an error.

The ToByte implementation is the same as ToByte. (In addition information, see Byte, Convert and Value.)

See Also

String Class | String Members | System Namespace