Righto.
What you will need to do is get the "search string" from the main providers you want to use, for instance with google, it'd be this:
string.Format("http://www.google.com/search?q={0}", "GoogleMe");
And for Bing, this would work:
string.Format("http://www.bing.com/search?q={0}", "BingMe");
Yahoo:
string.Format("http://search.yahoo.com/search?p={0}", "YahooMe");
Following the same pattern for other search engines. Example as follows:
private void Window_Loaded(object sender, RoutedEventArgs e)
{
Search(SearchProvider.Google, "StackOverflow");
}
private void Search(SearchProvider provider, string keyword)
{
Uri UriToNavigate = null;
switch (provider)
{
case SearchProvider.Google:
{
UriToNavigate = new Uri(
string.Format("http://www.google.com/search?q={0}", keyword));
break;
}
case SearchProvider.Bing:
{
UriToNavigate = new Uri(
string.Format("http://www.bing.com/search?q={0}", keyword));
break;
}
case SearchProvider.Yahoo:
{
UriToNavigate = new Uri(
string.Format("http://search.yahoo.com/search?p={0}", keyword));
break;
}
}
Browser.Navigate(UriToNavigate);
}
enum SearchProvider
{
Google = 0,
Bing = 1,
Yahoo = 2,
}