0

Hie, I am very new to C# and I want to search in a toolbox of a http site and get the result of that . Any suggestion? I would be very grateful for your kind help.

minoo
  • 555
  • 5
  • 20
  • I'd suggest using xpath. Note, html pages are frequently ill-formed so use some kind of parser: http://htmlagilitypack.codeplex.com/wikipage?title=Examples might be a good start. – Mikl X Dec 28 '15 at 09:52

1 Answers1

0

You mean Textbox? If it is Textbox there are plenty of ways you can do searching in textbox. One is given in below link that will give you some idea.

<input type="text" />
<ul id="theList">
 <li>xxvxvxx</li>
 <li>yyyyyyyyyy</li>
 <li>rrrrrrrrrr</li>
 <li>vvvvvvvvvvv</li>
 <li>xcvcvdfsdf</li>
 <li>hkjhkhjkh</li>
 <li>xzfgfhfgh</li>
</ul>

JS

$('input').keyup(function() {
  filter(this); 
});

function filter(element) {
var value = $(element).val();
$("#theList > li").each(function () {
    if ($(this).text().indexOf(value) > -1) {
        $(this).show();
    } else {
        $(this).hide();
    }
});
}

http://jsfiddle.net/sushanth009/yMBYa/3/

Nithin Paul
  • 2,169
  • 3
  • 33
  • 55
  • what I want to do is that when I write something in a textbox of a form instantly it searches that word in a searchbox of a specific site and prints the result of that in another textbox – minoo Dec 28 '15 at 10:57
  • Ok then you may need to use Jquery autocomplete for that purpose. Please check http://stackoverflow.com/questions/21385892/how-to-use-source-function-and-ajax-in-jquery-ui-autocomplete – Nithin Paul Dec 28 '15 at 12:06
  • WebClient client = new WebClient(); txtResult.Text = client.DownloadString(txtURL.Text); if (txtResult.Text.Contains(txtFind.Text)) { MessageBox.Show("Find"); } else MessageBox.Show("Not find"); – minoo Dec 29 '15 at 10:26
  • you know i have written this but as you see is not exactly what i want, i am very new and i don't know what should i do exactly – minoo Dec 29 '15 at 10:28
  • @minoo Did you try the FOURTH suggested answer in this http://stackoverflow.com/questions/21385892/how-to-use-source-function-and-ajax-in-jquery-ui-autocomplete – Nithin Paul Dec 29 '15 at 10:38
  • yes, but i don't know how can i use it in my code @Nithin – minoo Dec 29 '15 at 11:46
  • @minoo Which technology you are using asp.net or MVC? – Nithin Paul Dec 29 '15 at 12:05
  • i am using windows form application C# on visual studio 2015 – minoo Dec 29 '15 at 12:09