Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Equivalent of Shellexecute in csharp ?

1 view
Skip to first unread message

Diego Armando Maradona

unread,
May 12, 2008, 7:38:01 AM5/12/08
to
Hi,

I am using toshiba tec sx8 thermal printer for printing our labels,

in My old Delphi application I was using such code;

ShellExecute(0,'open',Data.cmdbuffer, PChar('/c copy
'+ExtractFilePath(Application.ExeName)+'PRINTER\ZZ3.PRN
'+dmoMain.PRINTER+':'), nil, SW_HIDE);

frmStockCardReport.QuickRep1.Preview;

ShellExecute(0,'open',Data.cmdbuffer, PChar('/c copy
'+ExtractFilePath(Application.ExeName)+'PRINTER\ZZ2.PRN
'+dmoMain.PRINTER+':'), nil, SW_HIDE);

After writing new program on .net, How can I write equivalent of above codes
?

Thanks


Gilles Kohl [MVP]

unread,
May 12, 2008, 8:13:45 AM5/12/08
to

Check out the System.Diagnostics.Process class, e.g. its static

public static Process Start(string fileName, string arguments)

overload.

You may want to explore other techniques for printing than sending
files to the printer port via "cmd copy /c filename lpt1:" (or
similar) though.

Regards,
Gilles [MVP].

(Please reply to the group, not via email.
Find my MVP profile with past articles / downloads here:
http://www.gilleskohl.de/mvpprofile.htm)

Ignacio Machin ( .NET/ C# MVP )

unread,
May 12, 2008, 2:48:39 PM5/12/08
to
On May 12, 7:38 am, "Diego Armando Maradona" <Some...@Somewhere.Co.Uk>
wrote:

There is a Process class you can use.

Additiobnally try to print directly from C#, There is a serial port
class that I think you can use for that.

0 new messages