Search This Blog

Friday, February 26, 2016

XmlNamespaceManager class c#

C# > XML > XmlNamespaceManager

XML namespaces associate element and attribute names in an XML document with custom and predefined URIs.

Methods












Tuesday, February 23, 2016

Convert ushort to byte array and to ASCII code C# using BitConverter

C#  > System > BitConverter

Converts 

  • base data types to an array of bytes,
  • array of bytes to base data types.


Example

Convert ushort to ASCII code.
(ascii code 2 bytes array)


ushort number = 5678;

byte[] byteArray = BitConverter.GetBytes(number);

foreach (var result in byteArray)
{
string val = System.Convert.ToChar(result).ToString();
}





Friday, February 5, 2016

How To Convert A Number To an ASCII Character C#

C#  > System > Convert > ToChar

Converts the value of the specified 8-bit unsigned integer to its equivalent Unicode character.

Example

Convert a number to an ASCII Character

 var asciiCode = System.Convert.ToChar(65).ToString(); // 'A'





Convert Class C#

C#  > System > Convert Class

This class is used for conversion to and from the base data types in the .NET Framework.

Methods