且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用C#在网页中打印文本文件?

更新时间:2023-10-28 13:46:22

您不能-不允许您了解客户端所使用的环境,其中包括任何打印工具.***的办法是打开一个包含文本文件内容的新浏览器窗口,然后使用javascript window.print()函数.
You can''t - you are not allowed to know about the environment the client is working in, and that includes any print facilities. The best you can do is open a new browser window holding the text file content, and use the javascript window.print() function.