PDA

Click to See Complete Forum and Search --> : [RESOLVED] Help to send data using winsock


Nerd-Man
Jan 18th, 2007, 07:57 AM
i have to send a long chunk of data by winsock but the probelm is how can i do that in 2 line. example..

Winsock1SendData "GET http://www.domian.com/themessagelinkhere/editpage.sendorsubmit HTTP/1.1" & vbCrLf

so i want to send the data in 2 seperate lines like below

Winsock1SendData ("GET http://www.domian.com/themessagelinkhere/), _
(editpage.sendorsubmit HTTP/1.1") & vbCrLf & vbCrLf

but i forgot how to use _ in vb or winsock so i can send the correct data to the server..

si_the_geek
Jan 18th, 2007, 12:27 PM
To split a string across multiple lines you need to 'close' it at the end of one line, and 're-open' it on the next, eg:
Winsock1SendData "GET http://www.domian.com/themessagelin...ge." _
& "sendorsubmit HTTP/1.1" & vbCrLf

DigiRev
Jan 18th, 2007, 01:06 PM
Also, you don't need to specifiy the domain name in the GET request...

So you can just send everything after ".com"

Nerd-Man
Jan 18th, 2007, 01:41 PM
thanks peoples, i really have no word to thanks you all. i really learn alot from this site and so if i can do anything to help this forum then i will. :wave:

Nerd-Man
Jan 18th, 2007, 01:43 PM
and you both guys are big help me to me and i did learn so many things from you... thanks alot... :wave:

Al42
Jan 18th, 2007, 01:52 PM
You can also put the string into a string variable and use that as the parameter, instead of using the literal string. In case of problems, that gives you something to Debug.Print or MsgBox, so you can see if the string you thought you're sending is really the one you're sending.