Results 1 to 6 of 6

Thread: [RESOLVED] Help to send data using winsock

  1. #1

    Thread Starter
    Lively Member Nerd-Man's Avatar
    Join Date
    Dec 2006
    Location
    India
    Posts
    119

    Resolved [RESOLVED] Help to send data using winsock

    i have to send a long chunk of data by winsock but the probelm is how can i do that in 2 line. example..

    VB Code:
    1. Winsock1SendData "GET [url]http://www.domian.com/themessagelinkhere/editpage.sendorsubmit[/url] HTTP/1.1" & vbCrLf

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

    VB Code:
    1. Winsock1SendData ("GET [url]http://www.domian.com/themessagelinkhere/)[/url], _
    2. (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..

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Help to send data using winsock

    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:
    VB Code:
    1. Winsock1SendData "GET [url]http://www.domian.com/themessagelin...ge[/url].[b]"[/b] _
    2.       [b]& "[/b]sendorsubmit HTTP/1.1" & vbCrLf

  3. #3
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Help to send data using winsock

    Also, you don't need to specifiy the domain name in the GET request...

    So you can just send everything after ".com"

  4. #4

    Thread Starter
    Lively Member Nerd-Man's Avatar
    Join Date
    Dec 2006
    Location
    India
    Posts
    119

    Resolved Re: Help to send data using winsock

    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.

  5. #5

    Thread Starter
    Lively Member Nerd-Man's Avatar
    Join Date
    Dec 2006
    Location
    India
    Posts
    119

    Resolved Re: Help to send data using winsock

    and you both guys are big help me to me and i did learn so many things from you... thanks alot...

  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Help to send data using winsock

    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.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width