使用vb.net打印文本文件 [英] textfile print using vb.net

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

问题描述

任何帮助表示赞赏。



打印没有发生。我使用以下代码打印生成并位于名为salesbill.txt的发布文件夹中的帐单。生成账单后,两个文件(批处理文件和txt文件)都在文件夹(G:\ ANIYAN \Projects\silentproject \ bin \ Release)中。但它没有印刷。是什么原因?

如果我直接打印一个





any help is appreciated.

printing is not happening. i am using the following code to print the bill which is generated and located in the release folder named as salesbill.txt. both files(batch file and txt file) are there in folder(G:\ANIYAN\Projects\silentproject\bin\Release) after generating bill. but it is not come into print. what is the reason?
if i print directly a


           Dim hFile As Long

'call funtion for make a format in print page and content and add in print()
'example 
'Print(hfile, ManageSpace("Receipt No: " + ds.Tables(0).Rows(0).Item("RR_Number").ToString, 20, 1))


          hFile = FreeFile()

          Dim StrFile2 As String

          StrFile2 = strAppPath &"\salesbill.txt";
'StrFile2=G:\ANIYAN\Projects\silentproject\bin\Release\salesbill.txt
          FileOpen(hFile, StrTmpReportBatFile, OpenMode.Output)
          Print(hFile,"TYPE"&StrFile2 &">prn")

          FileClose(hFile)
          Shell(StrTmpReportBatFile, AppWinStyle.Hide)

推荐答案

或者使用dos命令:

Or using dos command :
Dim monProcess As New Process()
 monProcess.StartInfo.FileName = Chemin
 monProcess.StartInfo.Verb = "Print"
 monProcess.StartInfo.CreateNoWindow = True
 monProcess.Start()


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

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