tags:

views:

345

answers:

4
public static void Main(string[] args){
    SearchGoogle("Test");
    Console.ReadKey(true);
}

static void SearchGoogle(string t){
    Process.Start("http://google.com/search?q=" + t);
}

Is there any way to hide the browser, so it won't pop up??

+1  A: 

Perhaps you are looking for ProcessStartInfo.CreateNoWindow ?

ohadsc
A: 

Something like:

ProcessStartInfo startInfo = new ProcessStartInfo("http://google.com/search?q=" + t);
startInfo.WindowStyle = ProcessWindowStyle.Hidden;

Process.Start(startInfo);
A: 

It looks like this is what you're looking for... Calling Yahoo with C#

Brad Bruce
A: 

Not sure why you'd need to do this, but hey, everyone has a reason. Here's ProcessStartInfo code that does exactly what you need:

ProcessStartInfo psi = new ProcessStartInfo(string.Format("http://google.com/search?q={0}",t));
psi.RedirectStandardOutput = false;
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.UseShellExecute = true;

Process.Start(psi);
Kyle Rozendo