title: How do I connect and send ZPL instructions to a network printer?
body: <p>I have been able to connect using TcpClient by the ip address and everything works. </p>
  
  <p>I was told I need to change it to connect to the printer on the network by name, because the ip address will change. My question is, how would I go about doing this?</p>
  
  <p>This is how I am doing it right now</p>
  
  <pre><code>string zplString = "zlp print instructions"
  string printImage= "zlp instructions for png"
  
  using (var client = new TcpClient())
   {
     client.Connect(ipAddress, 0);
     using (var writer = new StreamWriter(client.GetStream()))
     {
      //Write ZPL String to connection
      writer.Write(zplString);
      writer.Flush();
      writer.Write(printImage);
      writer.Flush();
  
  return;
   }//Close streamwriter
   }//Close Connection
  }
  </code></pre>