Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I developing a application user window form, it use for test website application. It will set parameters (user agent, url address, DNS, ...) for Firefox browser or another browser and after start browser for testing.
Any idea! thanks!

What I have tried:

I use Process.Start for start browser, but i can't set parameters i need.
Posted
Updated 9-Aug-16 19:38pm

1 solution

Hi. Have you tried using one of the overloaded methods for Process.Start?

C#
System.Diagnostics.Process.Start(string filename, string arguments);


Process.Start Method (String, String) (System.Diagnostics)[^]
Process.Start Method (System.Diagnostics)[^]

For example:
C#
System.Diagnostics.Process.Start("firefox.exe", "-private http://www.google.com"); //Opens Firefox and displays Google homepage in a private window


Also, here are some Firefox arguments:
Command Line Options - Mozilla | MDN[^]

The same process also works with other browsers:
IE - filename:= iexplore.exe
Chrome - filename:= chrome.exe
 
Share this answer
 
v3
Comments
Mr.thang 10-Aug-16 2:31am    
Thanks @Jose Alvarado, i try it, but how to set user agent and informations about network like DNS, proxy

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900