Community discussion forum

Search Bar

Tags:
  • 2 months ago

    Hi and welcome subramanya aithal, Smiley Face

    What components you're using to search the net ? What's your code till now ?

    Please explain more. Wink

  • Advertisement

    Simply the fastest line-level profiler for .NET ever

    “The low overhead means it has minimal impact on the execution of my program”
    Mark Everest, Development Team Leader, Renault F1 Team Ltd.

    Try out the new ANTS Profiler 4 for yourself. Download your 14-day trial now

  • 2 months ago

    [Please note that it's my practical way, not a standard way, then you may encounter some problems in some cases.]

    => Please first give it a try :

    Put "C%23" in 'txtSearch.Text' then execute this :

    webBrowser1.Navigate(lblSearch.Text + txtSearch.Text);

    Worked? If you want a general command(then you can type anything like "C#") use the following :

    webBrowser1.Navigate(lblSearch.Text + System.Uri.EscapeDataString(txtSearch.Text));

    => Now if you want to know, What's the difference, read the remaining of this post :

    "%23" instead of "#", yes, even when you search with google in IE, google will create a link that includes "%23" instead of "#" for "q=" part, but why? because it's one of the special characters for a URI (you've seen that in a webpage address when it wants to go in a specific part of the page, like "#comments" will jump to the comments section). Since special characters have specific meanings, we can't use them anywhere without considering their meanings! Here is the role of '%' to help us. We can concatenate '%' with the hex value of an ASCII character(like '23' for '#') to represent a special character (and "%23" is the escaped representation of "#"). You can find ASCII values in 'ASCII Character Codes' of MSDN or anywhere else. Then we should find equivalent hex value of special characters and substitute them? yes, but there is an easy way to do that in C#, using 'EscapeDataString' method of 'System.Uri' class, that 'converts a string to its escaped representation'. Therefore, we should first pass our search query value(the string after "q=") to 'EscapeDataString()' and get its escaped representation, then use that to create whole of the URI :

    webBrowser1.Navigate(lblSearch.Text + System.Uri.EscapeDataString(txtSearch.Text));

  • 2 months ago

    Hello subramanya,

    That was nothing! just a bit of infos Wink.

    => To learn more for .NET : two ways(that you know) are : reading Books and eBooks (usually beginning with a good book(like Deitel's one) is mandatory). But for websites, I will mention best of them that I've used up to now, at the end of this post (please note that, these are ones that I've used, there are also another good ones, you should have a search ;) ). Also you know, websites are changing, new ones maybe added just in one month, then you should always search the net for them.

    An important point in your question is 'Mastering' in .NET. I should tell you that it's an easy field to learn, but if you want to master in that, you should code as you can! That means: creating new programs in various fields, debugging them, searching the net for more infos,... . Actually, being involved in a real situation and real problems(like the one that you had in searching with google), that's the key! Geeked

    http://www.codeproject.com (most famous, huge source for all kinds!)

    http://www.codeguru.com (like codeproject.com )

    http://www.devx.com (the third one)

    (the followings are not in an importance sequence, all are good! ;) )

    http://www.programmersheaven.com 

    http://www.planet-source-code.com

    http://bytes.com (really good for its forums, huge source man!)

    http://www.programmingtutorials.com (good for tutorials)

    http://www.functionx.com (good for learning with sample programs)

    http://www.tek-tips.com (just another forum!)

Post a reply

Enter your message below

Sign in or Join us (it's free).