Ajinkya Ban

Ajinkya Ban

  • NA
  • 32
  • 42.8k

How to compare browser searching string with string in c#?

Apr 25 2014 1:59 AM
Hi,
 
I want to compare the string that entered into browser and if my string match with the keyword which are decalared into c# gives the message to the user that is "Correct".
 
For Ex:
 
Suppose i m enter the keyword "Digital Camera" in google chrome and my keyword contains the same name then displays messages "Correct"
 
This is my code but not working.
 
public void funct387()
{
Boolean mess = false;
string url = ie.LocationURL.ToString();
//string keyword = ie.Name.Contains("digital camera").ToString();
if (url.Contains("digital camera"))
{
mess = true;
}
canceliecommand();
if (mess)
{
BTS_Exam.Messagebox.Messagebox3 m1 = new BTS_Exam.Messagebox.Messagebox3();
m1.ShowDialog();
}
else
{
BTS_Exam.Messagebox.Messagebox4 m1 = new BTS_Exam.Messagebox.Messagebox4();
m1.ShowDialog();
}
}
Thanks in advance.. 

Answers (1)