Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

More translate C# to COBOL

$
0
0

Hello,

I need one more help converting these instructions from C # to Cobol.

The purpose of the code is to send the ZPLString string to a printer where the IP is ipAddress.

 

// Printer IP Address and communication port
string ipAddress = "10.3.14.42";
int port = 9100;
 
// ZPL Command(s)
string ZPLString =
    "^XA" +
    "^FO50,50" +
    "^A0N50,50" +
    "^FDHello, World!^FS" +
    "^XZ";
 
try
{
    // Open connection
    System.Net.Sockets.TcpClient client = new System.Net.Sockets.TcpClient();
    client.Connect(ipAddress, port);
 
    // Write ZPL String to connection
    System.IO.StreamWriter writer =
new System.IO.StreamWriter(client.GetStream());
    writer.Write(ZPLString);
    writer.Flush();
 
    // Close Connection
    writer.Close();
    client.Close();
}
catch (Exception ex)
{
    // Catch Exception
}
 
 
That's what I'm missing to finish the access control project.
 
Best regards.
Alberto Ferraz

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>