I'm using this code:
Process p = new Process();
ProcessStartInfo si = new ProcessStartInfo();
si.UseShellExecute = true;
si.FileName = Url;
p = Process.Start(si);
p.WaitForExit();
To open the "Url" in the default browser. I want to wait for the user to close that browser and then execute the code further. But after opening the Url in IE (my default browser), it throws an Object reference not set to an instance of object and highlights
p.WaitForExit();
What is the problem? I just want to wait until it finishes. Thanks for any advice.