使用 C# 通过 LPT1 端口和网络打印机打印文本文件以进行快速打印

发布于 2024-10-09 09:18:56 字数 669 浏览 0 评论 0原文

我必须打印使用 Crystal Report import 创建的文本文件。现在我必须将其直接打印到 LPT1 端口以进行快速点阵打印。我使用了下面的代码,没有任何效果。任何帮助将非常感激。

1.System.Diagnostics.Process.Start("打印", @"\D:LPT1" +" "+ txtFilepath);

  1. System.Diagnostics.Process printProcess = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo PrintStartInfo = new ystem.Diagnostics.ProcessStartInfo("Print.exe");

字符串 STRARGS = txtFilepath + " " + "/D:LPT1"; PrintStartInfo.Arguments = STRARGS; printProcess.StartInfo = PrintStartInfo; 打印进程.Start();

printProcess.WaitForExit();

3.System.Diagnostics.Process.Start("打印", txtFilepath);

请帮助我

问候, 马丁.

I have to print a text file created using Crystal Report import . now i Hve to print it directly to LPT1 port for fast dotmatrix printing . I used the below code, nothing is working . Any help would be greatly apprecialtable .

1.System.Diagnostics.Process.Start("Print", @"\D:LPT1" +" "+ txtFilepath);

  1. System.Diagnostics.Process printProcess = new System.Diagnostics.Process();
    System.Diagnostics.ProcessStartInfo PrintStartInfo = new ystem.Diagnostics.ProcessStartInfo("Print.exe");

string STRARGS = txtFilepath + " " + "/D:LPT1";
PrintStartInfo.Arguments = STRARGS;
printProcess.StartInfo = PrintStartInfo;
printProcess.Start();

printProcess.WaitForExit();

3.System.Diagnostics.Process.Start("Print", txtFilepath);

Please help me

Regards,
Martin.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

薄荷梦 2024-10-16 09:18:56

检查下面的链接。它会解决你的问题。

如何将原始数据发送到打印机

Check the below link. It will solve your problem.

How to Send Raw Data to Printer

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文