Why cannot start Process using C#?

  • Thread starter Thread starter Yiu
  • Start date Start date
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!!!
 
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
 
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)
 
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
--------------------
 
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
 
Back
Top