爱学习的兔八哥
2021-07-06 10:57
浏览 8

C# 封装 LeadTools 虚拟打印机报错

代码如下:

            string documentPrinterRegPath = @"SOFTWARE\LEAD Technologies, Inc.\19\\Printer\";
            PrinterInfo printerInfo = new PrinterInfo();
            printerInfo.MonitorName = printerName;
            printerInfo.PortName = printerName;
            printerInfo.ProductName = printerName;
            printerInfo.PrinterName = printerName;
            printerInfo.Password = printerPassword;

            printerInfo.RegistryKey = documentPrinterRegPath + printerName;
            printerInfo.DriverName = "Leadtools Printer";
            printerInfo.RootDir = @"C:\LEADTOOLS 19\Bin\Common\PrinterDriver\bin\";
            printerInfo.Url = "https://www.leadtools.com";
            printerInfo.PrinterExe = @"D:\work\test\TestPrint\TestPrint\bin\Debug\TestPrint.exe";
            printerInfo.AboutString = "LEADTOOLS Printer";
            //printerInfo.AboutIcon = System.IO.Path.Combine(Leadtools.Demos.DemosGlobal.ImagesFolder, "PrinterDriver.ico");

            Printer.Install(printInfo);  // 安装时报错

注册表中 ConnectionExe 对应的exe也是存在的。

但运行后报错:connection file not found。
有遇到过类似问题的吗 ?请问如何解决?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

相关推荐 更多相似问题