如何使用C#编码进行.TXT打印... [英] HOW TO TAKE .TXT PRINTOUT BY USING C# CODING...

查看:66
本文介绍了如何使用C#编码进行.TXT打印...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编码..
单击一个按钮,将输出打印文件,该文件是.txt文件..
您可以使用ms-dos或c#..

i need coding..
click a button printout will come,that source is .txt file..
you may use ms-dos or c#..

推荐答案

StreamReader sr=new StreamReader("C:\\Test.txt")
int count=File.ReadAllLines("C:\\Test.txt").Length;
for(int i=0;i<count;i++)>
{
MessageBox.Show(sr.ReadLine());
}



然后添加您的项目PrintDialog和PrintDocument,如果要查看预览PrintPreview.请在www.google.com上进行一些搜索.



Then Add your project PrintDialog and PrintDocument, and if you want to see a preview PrintPreview.And a little search for these on www.google.com please.


这篇关于如何使用C#编码进行.TXT打印...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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