You can open a hyperlink in the default browser using:
Process.Start(myHyperlink);
EDIT
Based on your comments, it seems you are having trouble accessing result_1
(etc.).
You define result_1
as a variable local to the method search_google()
public void search_google(string query) //Google Searching
{
#region link strings
string result_1 = "";
That means result_1
is only visible within that method.
Your if
and switch
statements do not appear to be part of search_google()
, so they can never see result_1
. If those statements are in a different method, you can work around that issue by moving result_1
to the class level (outside of search_google()
).
ON a site note, rather than defining ten individual result strings, you probably want to use an array of strings or a list of strings.