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

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
 
F

Family Tree Mike

Does the same thing happen when you paste the two urls into your default
browser? This is what appears to try to do.
 
M

Mufaka

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;
 

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