Botnaim

hello, i'm new to c# and currently making my first program.

i want my application to connect a server(a website) and to send data to it.

whilst i read about socket and figured how i can connect to another server, i don't understand how do i send data to it after i connect

bottom line is, after i connect my application to a website, how can i send data specifaclly to its search engine for example

(i want it to return the first result, how is that done )

thanks in advance to anyone that helps.



Re: .NET Framework Networking and Communication c# sockets concept question

ScubaSteve20001

Well you may not want to use something as low level as a socket. What you may want to do is use the HttpWebRequest class built into the .NET BCL. So then depending on your search engine, you can do a use a 'GET' command url to do a search and then the HttpWebRequest object will return the entire contents of that search. So what you will have to do after that is parse the HTML of the page for the first result. That is at least one way to do it, I know some search engine companies provide XML Web Service API's which can do similar things but make it a lot easier for the programmer to access specific data.




Re: .NET Framework Networking and Communication c# sockets concept question

Botnaim

can I connect a website with HTTPWebRequest or first I need to use sockets to connect the website

i'm not familiar with httpwebrequest, can you link me to someplace that explains it well





Re: .NET Framework Networking and Communication c# sockets concept question

ScubaSteve20001

No, you should not have to deal with sockets directly. The HttpWebRequest object is a higher level abstraction over top of sockets which is why you do not have to deal with them directly. Here is a link to a project that I think is something like you want to do, you may be able to look at the source or use this as a library to get the information you want. Take a look at the following article: http://www.codeproject.com/csharp/googleparser.asp