Easy 100 pts for using winsock

joooaaa used Ask the Experts™

I've been trying to find out how to go about using winsock in this way:

1) I want my program to go to a site so many times, each time changing something in the url (for example: taking each word from a listbox - one by one, and filling it into a certain part of the url).
2) Then retrieve its source each time it goes to the website and see if it contains a word or a phrase.
3) If it does, then it would add that word or phrase to a listbox.

I'm really a newb at winsock, so I'd like a code that would explain how winsock works and I'd like to know what are the privalages of winsock and what I can do with it (sockets, e.t)?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
hi dude, as a newb in this you know you have to read a lot.

so starts whith.

   astar with "Using MS Winsock Control"

  easy vb code and examples (hello world)

that's all
in that pages are others links for more examples

enjoy, put your glases on jejeje


This may help you.  Do you have to use Winsock?

It looks like you may be able to use XMLHTTP to accomplish what you need to do.  It's also very easy to implement.

This example requires MSXML2.dll

set oHTTP = CreateObject("MSXML2.ServerXMLHTTP")

'load FORUM main page and see if userName is online
sourceURL = "http://www.uselabgames.com/nl/voorbeelden/acno/forum/"

'connect to page and load into oHTTP
oHTTP.open "GET", sourceURL, false
oHTTP.setRequestHeader "cache-control", "no-cache"
oHTTP.setRequestHeader "pragma", "no-cache"

'Load page content into string variable
'Then parse it out to find the piece of information I am looking for.
responseText = oHTTP.responseText
searchKey = "<!-- Board Stats -->"
startPos = instr(responseText, searchKey)

if startPos > 0 then
     keyIsFound = true
end if
You are going to have to do HTML parsing as well. This can be accomplished by referencing the Microsoft HTML Object Library, or using the browser control.

Two more things you need to think about.

Oh yea...
Since you are filling out a form you will need a reference to Microsoft VBScript Regular Expressions 5.5, you can then use regEx to parse the names of the form controls/form.

** If this is a static form, you don't need to do this - just get the form element names etc **

hi try this site has lots of information on winsock for beginners tutors and samples,


hope that helps a little

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial