Why cannot start Process using C#?

Y

Yiu

upgent help
i want to start IE explorer using C#
i try many code such as below:
ProcessStartInfo startInfo = new ProcessStartInfo("IEXPLORE.EXE");
Process.Start(startInfo);

or

Process process = new Process();
process.StartInfo.FileName = "C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE";
process.StartInfo.Arguments = "http://www.simonweaver.com/";
process.StartInfo.CreateNoWindow = false;
process.StartInfo.UseShellExecute = true;*/
process .Start();

or

Process.Start("IEXPLORE.EXE","www.yahoo.com");

no any error (include running error) appear,
but the application does not appear
Help!!!
 
M

Markus Seger

Yiu said:
upgent help
i want to start IE explorer using C#
i try many code such as below:
ProcessStartInfo startInfo = new ProcessStartInfo("IEXPLORE.EXE");
Process.Start(startInfo);

or
[snip]

This worked on my machine:

Process process = new Process();

process.StartInfo.FileName = "http://www.simonweaver.com/";

process.StartInfo.Arguments = "";

process.StartInfo.CreateNoWindow = false;

process.StartInfo.UseShellExecute = true;

process.Start();



Good Luck!

Markus
 
C

chris

Yiu said:
upgent help
i want to start IE explorer using C#
i try many code such as below:
ProcessStartInfo startInfo = new ProcessStartInfo("IEXPLORE.EXE");
Process.Start(startInfo);

or

Process process = new Process();
process.StartInfo.FileName = "C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE";
process.StartInfo.Arguments = "http://www.simonweaver.com/";
process.StartInfo.CreateNoWindow = false;
process.StartInfo.UseShellExecute = true;*/
process .Start();

or

Process.Start("IEXPLORE.EXE","www.yahoo.com");

no any error (include running error) appear,
but the application does not appear
Help!!!


The above will get you going but have a look here for more details:
http://tinyurl.com/2j73y (MSDN site)
 
J

John Kn [MS]

Try this:

System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents=false;
proc.StartInfo.FileName="iexplore";
proc.StartInfo.Arguments="http://www.microsoft.com";
proc.Start();
proc.WaitForExit();
It is try and true.

Thanks,

J
--------------------
 
Y

Yiu

Sorry Markus
why i run your have the error say cannot find the file?


Markus Seger said:
Yiu said:
upgent help
i want to start IE explorer using C#
i try many code such as below:
ProcessStartInfo startInfo = new ProcessStartInfo("IEXPLORE.EXE");
Process.Start(startInfo);

or
[snip]

This worked on my machine:

Process process = new Process();

process.StartInfo.FileName = "http://www.simonweaver.com/";

process.StartInfo.Arguments = "";

process.StartInfo.CreateNoWindow = false;

process.StartInfo.UseShellExecute = true;

process.Start();



Good Luck!

Markus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top