Results 1 to 3 of 3

Thread: checking binary data

  1. #1

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919

    checking binary data

    im reading in binary data from the Inet control for movies.

    sometimes it 404s however, and when i open the file in wordpad, the html 404 page is there. how do i check whether it 404d?

    VB Code:
    1. vtData = Inet1.GetChunk(256, 1)
    2. tmplen = UBound(vtData)
    3. length = length + tmplen 'get the total size
    4.                        
    5.  if instr(1,vtData,"404") then
    6.     ....

    i tried that, doesnt work, when i debug.print it, its full of ? marks.

    any ideas? i think its a conversion from binary to ascii, which i dont know how to do..

    thanks
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    I think you have a byte array, not a string...
    Code:
    z = ubound(vtdata)
    limit - z -2
    For i = 1 to limit ' we won't worry about a character 4 too near the end
        if vtdata(i)=52 then ' a four
            if vdata(i+1) = 48 and vtdata(i+2)= 48 then
                          msgbox "404 found"
                          exit for
        end if
    next

  3. #3

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919
    ah okidoke, thanks.

    but there isnt a faster way? like checking the first x number of bytes, instead of checking every 255 that comes in?

    actually, ill work on it. thanks
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

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