Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/309.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# 32位应用程序的打印机驱动程序主机已停止工作_C#_Printing - Fatal编程技术网

C# 32位应用程序的打印机驱动程序主机已停止工作

C# 32位应用程序的打印机驱动程序主机已停止工作,c#,printing,C#,Printing,我有一个用C#编写的应用程序,可以从各种用户控件和表单打印标签。我经常遇到一个错误,在这里我会看到一个小窗口对话框,上面写着“32位应用程序的打印机驱动程序主机已停止工作” 由于它不是在打印后直接发生的,我不确定它是否与我的代码有关,但这里是我用来打印标签的函数 try { fontware_code128 Barcode = new fontware_code128(); Font

我有一个用C#编写的应用程序,可以从各种用户控件和表单打印标签。我经常遇到一个错误,在这里我会看到一个小窗口对话框,上面写着“32位应用程序的打印机驱动程序主机已停止工作”

由于它不是在打印后直接发生的,我不确定它是否与我的代码有关,但这里是我用来打印标签的函数

            try
            {
                fontware_code128 Barcode = new fontware_code128();
                Font myFont = new Font("Arial", 24);

                PrintDocument printDoc = new PrintDocument();
                printDoc.DocumentName = "Standard Label";
                printDoc.DefaultPageSettings.PrinterSettings.PrinterName = Helper.GetPrinterName();
                printDoc.DefaultPageSettings.Landscape = true;
                printDoc.DefaultPageSettings.Margins = new Margins(10, 10, 10, 10);
                printDoc.PrintController = new StandardPrintController(); 

                printDoc.PrintPage += (sender, args) =>
                {
                    args.Graphics...
                };

                printDoc.Print();

                this.Close();

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
非常感谢您的帮助,如需更多详细信息,请咨询

表示可能发生错误,因为Microsoft没有在OEM安装CD上包含所有打印驱动程序,因此打印机可能安装不正确。本文概述的修复方法是:

  • 卸载计算机上已安装的所有打印机
  • 将打印机重新安装为本地连接的网络打印机
  • 键入打印机的主机名或IP地址。确保取消选中“查询打印机”并自动选择驱动程序
  • 单击Windows Update以获取打印机驱动程序的更新列表,并找到相应的驱动程序

  • 参考:

    打印机驱动程序崩溃。对此你无能为力。访问制造商网站以查找驱动程序更新。或者买另一个,花更多的钱在上面。谢谢你的文章链接,我已经按照步骤-希望它能工作!