Urgent Help required - ProcessStartInfo Hangs. Please help.....

  • Thread starter Thread starter Ravi
  • Start date Start date
R

Ravi

All,


I have two smart client application and i am trying to invoke those two from
C#.NET windows application project. Below is the sourc code.

public void processexec(String URL)
{
try
{
System.Diagnostics.ProcessStartInfo psInfo = new ProcessStartInfo();
psInfo.FileName = URL;
psInfo.Arguments= String.Empty;
psInfo.WindowStyle= ProcessWindowStyle.Hidden;
Process.Start(psInfo);
}
catch(Exception Ex)
{
MessageBox.Show(Ex.Message);
}
}

In command button click(), i have written the below code.
{
processexec("http://server1/testapp1/testapp1.application");
processexec("http://server1/testapp2/testapp2.application");
}

Error displayed like "An error occurred in sending the command to the
application". This is catched as exception.

Please help me on this.

Regards, Ravi
 
Does the same thing happen when you paste the two urls into your default
browser? This is what appears to try to do.
 
I think you need to make the FileName property be the path to a web
browser and the Arguments property should be the url. You should also be
able to set the FileName to "explorer" because it will also launch the url.

Your process is executing in the context of a shell which is not the
same as start/run.

So, in your code, try modifying those two properties as:

psInfo.FileName = "explorer";
psInfo.Arguments = URL;
 
Back
Top