473,378 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

problem with ProcessStartInfo

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?
Jun 27 '08 #1
2 3123
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" wrote:
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?
Jun 27 '08 #2
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();
"bruce barker" wrote:
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" wrote:
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?
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stedak | last post by:
My application seems to freeze when Microsoft Office Document Imaging is set as the default for loading images. If the Windows Picture and Fax Viewer is used there is no problem. When I set a break...
0
by: Matt | last post by:
I am running a exe from command line in my application and when I use ProcessStartInfo it seems to duplicate all the commands within the function. for instance I write a file. Without my...
0
by: Leo Heska | last post by:
Hi I haven't seen the following problem mentioned anywhere We have an application written in VB.NET which executes a batch file (named startJob.cmd). We have discovered that if that batch file...
0
by: ALI-R | last post by:
I am using the code below to open Outlook as user clicks on "Email this page" try { string subjectEmail=string.Format("Magnet Alert Center - Alerts for : {0}",Request.QueryString);
7
by: WALDO | last post by:
I wrote a console application that basically consumes arguments and starts other command line apps via System.Process. Let's call it XCompile for now. I wrote a Visual basic add-in that does pretty...
1
by: Philip Wagenaar | last post by:
How do I set the string "myPass" for ProcessStartInfo.Password? Dim instance As ProcessStartInfo instance.Password "myPass" 'This is no good because its System.Security.String instance.UserName...
2
by: Bala Nagarajan | last post by:
Hello, I am having issues when i use the Systsem.Diagnostics.Process namespace to start a process. The problem is that i am able to succeed in starting a process (an exe) only few times in a row...
1
by: sunny | last post by:
Hi all We have a pdf user manual which we open when client clicks on help button. some of our clients have the issue that it does not open the file and it says file not found. checked with...
4
by: melisa | last post by:
I'm writting a method which will start a new specified program and specified file e.g start testdoc.doc with WINWORD.exe as below: private void Start_Process() { ProcessStartInfo startInfo =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.