在vb.net中通过Shell命令打印 [英] Printing by Shell command in vb.net

查看:110
本文介绍了在vb.net中通过Shell命令打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在vb.net中使用Shell函数进行打印?
谁能给点光?
Shell接受参数(exe文件的路径和状态等),但不接受要打印文件的文件路径!

How to use Shell function in vb.net for printing?
Can anyone throw some light?
Shell accepts arguments(Path of exe file and status etc) but not file path of the file to be printed!

推荐答案

也许会有所帮助

使用此命令

打印命令 [ System.Diagnostics.Process类 [
maybe this will help

use this command

Print Command[^]

via the

System.Diagnostics.Process Class[^]


此我将如何在C#中做到这一点

this is how I''d do it in C#

Process p = new Process();
p.StartInfo.FileName = "print";
p.StartInfo.Arguments = @"/D:COM3 c:\myFile.txt";
p.Start();


我不认为上面的方法可以工作,因为DOS不了解USB端口-恐怕只有串行和并行.因此,您可以做以下三件事之一:
1)模拟网络打印机-参见此处:
http://geekswithblogs.net/dtotzke/articles/26204.aspx [ http://www.dosprn.com/ [ ^ ]
3)如果可能的话,请不要直接写到打印机上,而要使用更多最新技术!

希望这会有所帮助.
I don''t think the above will work as DOS doesn''t know about USB ports - only serial and parallel I''m afraid. So you could do one of three things:
1) Emulate a network printer - see here:
http://geekswithblogs.net/dtotzke/articles/26204.aspx[^]
2) Download DOSPRN shareware - see here:
http://www.dosprn.com/[^]
3) If you at all possible don''t write directly to the printer but use more up-to-date technology!

Hope this helps.


这篇关于在vb.net中通过Shell命令打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆