使用WIN32 API打印文件

编程入门 行业动态 更新时间:2024-10-27 08:35:26
本文介绍了使用WIN32 API打印文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要将我的SPFolder中找到的文件直接打印到打印机而不识别文件类型,以便调用哪个Windows API以及如何调用它?当有多个文件同时打印时,启动打印作业的过程是什么?

I need to print my Files found in my SPFolder directly to the Printer without recognizing the file type, so which Windows API to call and how to call it ? Also what's the process to launch the printing job when there are many files to print at the same time ?

推荐答案

如果使用C#,直接使用Win32 API打印将是1)笨拙,难以实现,2)不是平台可移植的(与使用 CLI 和.NET FCL - 您可以在非编号上运行代码微软平台)。 我认为没有任何可以获得任何好处的情况。由于大多数成员也不喜欢把时间花在没有意义或没有用的东西上,你需要提供一个令人信服的动机你想要什么,但我认为你不能成功。
-SA
If you use C#, printing directly with Win32 API would be 1) awkward, hard to implement, 2) not platform-portable (in contrast to using CLI and .NET FCL — you would be able to run your code on a number non-Microsoft platforms). I see no situations where you can get any benefits of it. As most members also don't like waste their time on something which does not make sense or not really useful, you will need to provide a convincing motivation of what you want, but I don't think you can succeed.
—SA

您好, 您可以使用假脱机程序API。本文可以帮助您: http://支持.microsoft / kb / 322091 / zh-CN [ ^ ] support.microsoft/ kb / 138594 / zh-CN [ ^ ] 问候, Maxim。 Hello, You can use spooler API. This articles helps you: support.microsoft/kb/322091/en-us[^] support.microsoft/kb/138594/en-us[^] Regards, Maxim.

这就是你要找的东西: This is what you're looking for: var processStartInfo = new ProcessStartInfo(filename) { Verb = "Print", CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden }; Process.Start(processStartInfo);

更多推荐

使用WIN32 API打印文件

本文发布于:2023-10-08 13:50:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1472820.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!