使用ASP.net打印到LPT1端口 [英] Print to LPT1 port using ASP.net

查看:99
本文介绍了使用ASP.net打印到LPT1端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要使用asp.net Web应用程序打印到LPT1端口.
我正在使用.net4.0.任何人都可以提供一些指针来实现这一目标吗?

在此先感谢,

Achus

Hi,

I need to print to a LPT1 port using asp.net web application.
I am using .net4.0 .Can anyone give some pointers to achieve this?

Thanks in Advance,

Achus

推荐答案

出于明显的原因,Web应用程序无法访问硬件.因此,将打印机连接到LPT1或以其他方式连接是没有区别的-这取决于客户端的OS,驱动程序等.因此,您只能使用正式安装在系统中的打印机进行打印:网络,本地USB,LPT等;对于Web应用程序,它们不过是打印机而已.

大多数应用程序仅依靠浏览器功能以及用户将页面发送到打印机的决定. 这种非侵入式方式是最好的.您唯一需要关注的是提供易于打印的内容:流畅,足够对比度,没有用于用户输入的活动控件等.您可以生成一个特殊的打印机友好页面(用户单击打印机图标),但是最好通过CSS区分不同的媒体并提供不同的媒体敏感样式来做到这一点.请参阅:
http://webdesign.about.com/cs/css/a/aa042103a.htm [ ^ ],
http://www.w3.org/TR/css-print/ [ http://www.dotnetcurry.com/ShowArticle.aspx?ID=92 [ ^ ].

我仍然建议第一种方法. 您的客户更了解何时打印以及打印什么;您的应用程序应尊重客户的决定并非侵入式地协助.

—SA
A Web application has no access to hardware, by apparent reasons. So, there is no difference is a printer is connected to LPT1 or in some other way — this is a matter of client''s OS, drivers, etc. So, you can only print using a printer formally installed in your system: network, local USB, LPT, whatever; for a Web application, they are nothing but just printer.

Most applications simply rely on the browser functionality and the user''s decision to send a page to printer. This non-intrusive way is the best. Your only concern should be providing printer-friendly content: fluid, contrast enough, free from active controls for user input, and so on. You can generate a special printer-friendly page (the user clicks on the printer icon), but it would be much better to do it through CSS discriminating different media and providing different media-sensitive styles. Please see:
http://webdesign.about.com/cs/css/a/aa042103a.htm[^],
http://www.w3.org/TR/css-print/[^].

For more advanced stuff, please see this article:
http://www.dotnetcurry.com/ShowArticle.aspx?ID=92[^].

I still recommend the first approach. Your customer knows better when to print and what to print; your application should respect customer''s decision and assist non-intrusively.

—SA


这篇关于使用ASP.net打印到LPT1端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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