Click here to Skip to main content
15,896,507 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to add buttons in my translation program for fast Wikipedia and Google Images searches.

What I have tried:

void buttonPictures_Click(object sender, EventArgs e)
        {
            webBrowserMain.Navigate(


         "images.google.co.il//search?q="   +webBrowserMain.Document.GetElementById("source").GetAttribute("value")

            );
        }

        void buttonWikipedia_Click(object sender, EventArgs e)
        {
            webBrowserMain.Navigate(


         "en.wikipedia.org//w//query=" + webBrowserMain.Document.GetElementById("source").GetAttribute("value")

            );
        }
Posted
Updated 1-Feb-17 22:13pm
Comments
Karthik_Mahalingam 2-Feb-17 3:12am    
are you getting the input value from textbox in winform?
john1990_1 2-Feb-17 3:13am    
i have a Google translate page and i take the text from the textbox there.
Karthik_Mahalingam 2-Feb-17 3:16am    
is that your custom web page?
john1990_1 2-Feb-17 3:48am    
i only need the right links instead of these that dont work:
"en.wikipedia.org//w//query="
"images.google.co.il//search?q="

i want the link that i add in it the text query to search, of Google Images and of Wikipedia search.
john1990_1 2-Feb-17 3:56am    
I found the one for Google Images:
google.com/search?site=&tbm=isch&q=dog

I figured them out:

"google.com//search?site=&tbm=isch&q=" + query

"en.wikipedia.org//wiki//Special:Search?search=" + query
 
Share this answer
 
void buttonPictures_Click(object sender, EventArgs e)
        {
            webBrowserMain.Navigate(
                "www.google.co.in/search?                       q="+webBrowserMain.Document.GetElementById("source").GetAttribute("value")+"  &tbm=isch" 

            );
        }

        void buttonWikipedia_Click(object sender, EventArgs e)
        {
            webBrowserMain.Navigate(
                     "en.wikipedia.org/wiki/"
       + webBrowserMain.Document.GetElementById("source").GetAttribute("value")

            );
        }
 
Share this answer
 

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