如何调用"打印图片"应用程序与Windows 7从.NET [英] How to invoke the "Print Pictures" application that comes with Windows 7 from .NET
问题描述
我正在做一个C#应用程序创建.JPGs。我真的很喜欢这个系统,您可以在一个.JPG在Windows 7中单击鼠标右键,选择打印
。我想调用,从我的C#应用程序,以便复制过程。怎样才能做到呢?我宁愿不通过创造我自己的对话框时,功能已经内置到Windows 7的漫长过程。
I'm making a C# application that creates .JPGs. I really like the system where you can right-click on a .JPG in Windows 7 and select Print
. I would like to invoke that from my C# application in order to replicate the process. How can it be done? I would rather not go through the lengthy process of creating my own dialogs when the functionality is already built into Windows 7.
推荐答案
好久没有回答,我终于找到了。很简单。在这里,它是:
No answer for ages, and I finally found it. So simple. Here it is:
Process p = new Process();
p.StartInfo.FileName = "file_name.jpg";
p.StartInfo.Verb = "Print";
p.Start();
请注意,该文件需要一个 .JPG
否则可能会做完全不同的事情,或者,最有可能的,什么都没有。
Note that the files needs to be a .jpg
otherwise it might do something completely different or, most likely, nothing at all.
这篇关于如何调用"打印图片"应用程序与Windows 7从.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!