Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/21.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# 在C中使用LPR打印PCL文件#_C#_.net_Printing_Window_Lpr - Fatal编程技术网

C# 在C中使用LPR打印PCL文件#

C# 在C中使用LPR打印PCL文件#,c#,.net,printing,window,lpr,C#,.net,Printing,Window,Lpr,我正试图使用lpr命令打印pcl文件。在这里,我的C#应用程序创建了一个新的进程来调用带有参数的lpr命令,参数包括pcl文件名等 但现在我面临这个问题,因为lpr命令只接受128长度的文件名。但是我的pcl文件路径比这个长。我试图将进程工作目录设置为pcl文件夹。虽然我设置了它,但lpr.exe引用绝对路径来检查文件是否存在 有没有什么创新的想法来解决这个文件路径长度问题 Proc.StartInfo.WorkingDirectory = pcl_file.Directory.ToString

我正试图使用
lpr
命令打印
pcl
文件。在这里,我的C#应用程序创建了一个新的进程来调用带有参数的
lpr
命令,参数包括
pcl
文件名等

但现在我面临这个问题,因为lpr命令只接受128长度的文件名。但是我的pcl文件路径比这个长。我试图将进程工作目录设置为
pcl
文件夹。虽然我设置了它,但lpr.exe引用绝对路径来检查文件是否存在

有没有什么创新的想法来解决这个文件路径长度问题

Proc.StartInfo.WorkingDirectory = pcl_file.Directory.ToString();
Proc.StartInfo.FileName = "lpr";
Proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
Proc.StartInfo.UseShellExecute = false;
Proc.StartInfo.RedirectStandardOutput = true;
Proc.Start();

一个快速的欺骗可能是使用短文件名。使用

不要这样做,为什么不能在项目的调试/释放文件夹中复制/粘贴pcl文件?