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

problem with ProcessStartInfo

1 view
Skip to first unread message

Mabelle@discussions.microsoft.com Michelle Mabelle

unread,
May 6, 2008, 5:38:05 PM5/6/08
to
I have the code below. It will open and print the pdf file (test.pdf) to the
printer.

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = true;
startInfo.Verb = "Print";
startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
startInfo.FileName = @"E:\\barcode\test.pdf";
Process p = new Process();
p.StartInfo = startInfo;
p.Start();

It works well on my local test machine. Once I copied it to the server, it
will not print or open the pdf file.
Anybody can help?

bruce barker

unread,
May 6, 2008, 5:49:00 PM5/6/08
to
on the server there is no profile setup for asp.net (on you dev box it runs
as you). this means no default printer. you will need to specify the printer.

-- bruce (sqlwork.com)

Michelle Mabelle

unread,
May 6, 2008, 5:59:01 PM5/6/08
to
Thank you Bruce!
I am not sure how to setup profile for asp.net...
Also, I specified printer on another part of the code as below:

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = true;

startInfo.Verb = "Printto";
startInfo.Arguments = @"\\UTzhangM\ZebraTLP";


startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
startInfo.FileName = @"E:\\barcode\test.pdf";
Process p = new Process();
p.StartInfo = startInfo;
p.Start();

0 new messages