Text file printout in dos mode through VB.Net or DOS command from VB.Net

Text file printout in dos mode through VB.Net or DOS command from VB.Net

Post by Hardik Sha » Thu, 09 Feb 2006 14:02:59


Hi,

I am generating a text file through vb.net and I want to give facility to my
user to take DOS base (fast) printiout of it ,

or in other words,

I want to run DOS command from my application. i.e. TYPE C:\TEST.TXT >PRN ,
How can I ?

Regards,


Hardik Shah
 
 
 

Text file printout in dos mode through VB.Net or DOS command from VB.Net

Post by Cor Ligthe » Thu, 09 Feb 2006 15:13:41

Hardik,

Using proces here one which is longer it can be one line as well.

\\\
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.UseShellExecute = False
pi.RedirectStandardOutput = True
pi.Arguments = "www.google.com"
pi.WorkingDirectory = "C:\windows\system32"
'this for nt* computers
pi.FileName = "ping"
p.StartInfo = pi
p.StartInfo = pi
p.Start()
Dim sr As IO.StreamReader = p.StandardOutput
Dim sb As New System.Text.StringBuilder("")
Dim input As Integer = sr.Read
Do Until input = -1
sb.Append(ChrW(input))
input = sr.Read
Loop
MessageBox.Show(sb.ToString)
///

I hope this helps,

Cor

 
 
 

Text file printout in dos mode through VB.Net or DOS command from VB.Net

Post by Herfried K » Fri, 10 Feb 2006 04:08:49

"Hardik Shah" < XXXX@XXXXX.COM > schrieb:

Depending on the printer you may find the article below useful:

HOW TO: Send Raw Data to a Printer by Using Visual Basic .NET
<URL: http://www.yqcomputer.com/ ;EN-US;322090>

--
M S Herfried K. Wagner
M V P <URL: http://www.yqcomputer.com/ ;
V B <URL: http://www.yqcomputer.com/ ;