简体   繁体   English

Godex标签印刷c#

[英]Godex lable printing with c#

I want to printing a label, but i cant.我想打印 label,但我不能。 I watched lot of video about this, but i cant find any solution.我看了很多关于这个的视频,但我找不到任何解决方案。 Here is my code: image I dont know what bool test do, because it never used.这是我的代码: image我不知道 bool test 做了什么,因为它从未使用过。 (I copied) (我抄的)

Anyone any idea?有人知道吗?

Update更新

I find a method, and it work.我找到了一种方法,而且有效。

I create a label with GoLabel program.我用 GoLabel 程序创建了一个 label。 Important.重要的。 Use only built-in text, After you done with the label. click the export button and it create a raw print code.仅使用内置文本,完成 label 后。单击导出按钮,它会创建一个原始打印代码。

In the program repleace the desired text with [printext].Repleace() method.在程序中用 [printext].Repleace() 方法替换所需的文本。 Save the text to a txt file.将文本保存到 txt 文件。 After, create a cmd string, and use this code:之后,创建一个 cmd 字符串,并使用以下代码:

 strCmdText = @"/C LPR -S " + ip + " -d -P raw toprinter.txt";

ip means the current printer IP address. ip表示当前打印机IP地址。

Finally, run it with cmd like this:最后,像这样用 cmd 运行它:

 System.Diagnostics.Process.Start("CMD.exe", strCmdText);

When the cmd app just pop up and close, you need to install windows SDK and move these files:当 cmd 应用刚刚弹出并关闭时,您需要安装 windows SDK 并移动这些文件:

enter image description here在此处输入图像描述

to:到:

C:\Windows\SysWOW64 

this directory.这个目录。

If you done with this, it will print your label.如果你完成了这个,它会打印你的 label。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM