小编The*_*one的帖子

'指定的可执行文件不是该操作系统平台的有效应用程序

我想在没有用户交互的情况下从 C# 代码打印 PDF 文件。

我尝试了这个已接受的答案,但它对我不起作用。

这是我尝试过的代码:

Process p = new Process();
p.StartInfo = new ProcessStartInfo()
{
     CreateNoWindow = true,
     Verb = "print",
     FileName = @"G:\Visual Studio Projects\PrintWithoutGUI\PrintWithoutGUI\Courses.pdf" //put the correct path here
};
p.Start();
Run Code Online (Sandbox Code Playgroud)

我得到这个例外:

System.ComponentModel.Win32Exception:“指定的可执行文件不是此操作系统平台的有效应用程序。”

c# printing process

7
推荐指数
2
解决办法
2万
查看次数

标签 统计

c# ×1

printing ×1

process ×1