I need to update this program to print to whichever printer the user has selected as their default printer. Currently I'm using the IP address of the printer but it will be different depending on the pc.
Socket clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
clientSocket.NoDelay = true;
PrinterSettings settings = new PrinterSettings();
IPAddress ip = IPAddress.Parse("ipaddress");
IPEndPoint ipep = new IPEndPoint(ip, 9100);
clientSocket.Connect(ipep);
try {
clientSocket.Send(output.ToArray());
} catch (Exception) {}