使用C#从文件夹打印所有文本文件 [英] printing all text file from folder using c#

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

问题描述

大家好,我创建了小型应用程序.该应用程序将打印我在编码中提到的文本文件.但是问题是我想从一个文件夹中打印文本文件,如果该文件夹包含N个文本文件,那么所有文本文件都应该被打印
整个编码过程请给我一些思路以及一些示例编码.

hi all i have creatd small application. that application will print text file which i mention in my coding. but the problem is i want to print text file from one folder, if that folder contains N no of text file.. that all text file shld be print
throught out coding pls give me some idea as well as some example coding. it will be highly greatful for me

推荐答案

,您需要通过打印命令将每个文件发送到打印机.
http://www.andreavb.com/forum/viewtopic_1963.html [
you need to send each file to to printer by print command.... watch this code :

http://www.andreavb.com/forum/viewtopic_1963.html[^]


您必须按照自定义进行编码需求

将System.IO命名空间添加到您的程序中

使用目录类的GetFiles方法从目录获取文件

然后发送每个文件进行打印

[edit]删除了txtspk [/edit]
You have to code as per your custom needs

Add System.IO namespace to ur program

use GetFiles method of Directory Class to get files from directory

then send each file for printing

[edit] removed the txtspk [/edit]


这可能有很大的帮助:
This could be of great help: Directory.GetFiles Method[^]


这篇关于使用C#从文件夹打印所有文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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