Sign in to follow this  
Followers 0
agnik

How to get image from web site use TCP

4 posts in this topic

Hi, i am a new one, and poor English

before i post data to a web site i need get a identify code image (and it sounds the connect need alive)

i use tcpsend() with 'GET'

it dose give me a something, like Header message and image data

but how do i save the image? how split message right?

or there is anther way ?

and please no tell me to search, because i did it many time and get nothing useful

help me!

sorry for my english

agnik

Share this post


Link to post
Share on other sites



This sure sounds like your intended goal is to get one of those validation strings that websites have as an anti-spam measure and then your hope is to somehow read it... Which never has anything but a deplorable intention attached to it... So how about you provide the following and maybe you'll get more help:

1. The website that you're trying to accomplish this on, and why

2. The code you've tried so far and what you get

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

This sure sounds like your intended goal is to get one of those validation strings that websites have as an anti-spam measure and then your hope is to somehow read it... Which never has anything but a deplorable intention attached to it... So how about you provide the following and maybe you'll get more help:

1. The website that you're trying to accomplish this on, and why

2. The code you've tried so far and what you get

it's a private site, but we can use google logo (http://www.google.com/intl/en_ALL/images/logo.gif)

my question is simple: how did i save the logo.gif?

i use this:

$host = 'www.google.com'
$page = '/intl/en_ALL/images/logo.gif'

Local $ConnectedSocket, $szData
Local $szIPADDRESS = TCPNameToIP($host)
Local $nPORT = 80
TCPStartup()

$ConnectedSocket = -1

$ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT)
If @error Then
;
Else
    $command = "GET "&$page&" HTTP/1.1"&@CRLF
    $command &= "Host: " &$host&@CRLF
    $command &= "Connection: close"&@CRLF
    $command &= ""&@CRLF
    
    $bytes = ''
    While 1
        Sleep(10)
        $recv = TCPRecv($ConnectedSocket, 16)
        If @error Then ExitLoop
        If $recv <> '' Then
            $bytes &= $recv
        EndIf
    WEnd

EndIf

and stuck...

i know the logo image data in the $bytes, but how i save the image to a file?

please help me, even it is very simple

(again, not inetGet)

Edited by agnik

Share this post


Link to post
Share on other sites

any body?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0