Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/262.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何向Zebra打印机发送线模型控制命令?_C#_Printing_Zebra Printers_Epl - Fatal编程技术网

C# 如何向Zebra打印机发送线模型控制命令?

C# 如何向Zebra打印机发送线模型控制命令?,c#,printing,zebra-printers,epl,C#,Printing,Zebra Printers,Epl,我有下面的代码,是我在将打印机置于行模式后发送的,但它在吞下[ESC]A后只打印'51' 更改字体的命令是[ESC]A51 需要一些正确的代码来规范打印机的输出 var stringVal = new string(new char[] { System.Convert.ToChar(0x1b) /* ESC */, 'A', Sys

我有下面的代码,是我在将打印机置于行模式后发送的,但它在吞下[ESC]A后只打印'51'

更改字体的命令是[ESC]A51


需要一些正确的代码来规范打印机的输出

var stringVal = new string(new char[] { System.Convert.ToChar(0x1b) /* ESC */, 
                                        'A', 
                                        System.Convert.ToChar(51) });
data = Encoding.Default.GetBytes(stringVal + NewLine);

connection.Write(data);
编辑

在这种情况下,A51需要注意。如果51是字符串,使用“5”、“1”或字符,使用System.Convert.ToChar51,则该命令的传递方式不同

连接的对象类型是什么?hexValue不正确写入hexValue=0x1b;?
var stringVal = new string(new char[] { System.Convert.ToChar(0x1b) /* ESC */, 
                                        'A', 
                                        System.Convert.ToChar(51) });
data = Encoding.Default.GetBytes(stringVal + NewLine);

connection.Write(data);