I'm implementing a OAUTH-type of authentication for a desktop application and in this process I need to open a webbrowser and then close it when token has been collected.
I've tried with this:
var p = Process.Start(new ProcessStartInfo(url));
...
p.Kill(); //this won't work as p is null = no new process started
According to the documentation:
If the process is already running, no additional process resource is started. Instead, the existing process resource is reused and no new Process component is created. In such a case, instead of returning a new Process component, Start returns
null
to the calling procedure.
Indeed, the page is just opened as a new tab in Chrome (my default browser) process that I've already have opened.
Any ideas on how to open a new process of the default browser that I can kill?