Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
How to print a text file in a browser using c# in console?

Thanks
Posted
Comments
Pravin Patil, Mumbai 12-Oct-11 5:42am    
You have totally messed up the question.... !!! Console, Browser, C#.... ?
Come again.. Do you want to print a file from Browser or Console application..?
sreenathpktr 12-Oct-11 5:53am    
Console application.

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900