Equivalent of Shellexecute in csharp ?

  • Thread starter Thread starter Diego Armando Maradona
  • Start date Start date
D

Diego Armando Maradona

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
 
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

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)
 
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

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.
 
Back
Top