IPHostEntry host;
string localIP = "0.0.0.0";
host = Dns.GetHostEntry(Dns.GetHostName());
foreach (IPAddress ip in host.AddressList) {
  if (ip.AddressFamily == AddressFamily.InterNetwork) {
    localIP = ip.ToString();
  }
}
Console.WriteLine(localIP);

 

Code Snippet

  ArrayList arr = new ArrayList(); 
  arr.Add(0x1b);
  arr.Add(0x41);
  arr.Add(0x1b);
  arr.Add(0x46);
  arr.Add(0x44);
  ...
  ...
  byte[] data = new byte[arr.Count];
  data = (byte[])arr.ToArray(typeof(byte));

Someone asked if 0,1 could be formatted to no,yes on your other page. This can be done with formatting using:

String.Format(“{0:yes;;no}”, value)

=> yes if value == 1
=> no if value == 0