473,394 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

reading only the first 30 bytes of an HTML file with xml object

Hi,

I wonder if there is a way to read only the first x bytes of a xml
responsetext. In my project I need only first 20-30 bytes of very large

HTML files and i don't want to wait for the rest to be read. Here is a
piece of code i use ;
Dim xml As New MSXML2.XMLHTTP
xml.Open "GET", address , False
xml.Send
MsgBox Left(CStr(xml.responseText),25), vbInformation, "Info..."

This code does the thing i want but i have to wait for all the body to
be read and only after that time i can parse the text. I want to stop
the process after 30. byte is read because of timing issues.

I also tried Inet control and saw a method like getChunk() which can
read the block mentioned but could not managed to use it.

If there is a way to overcome this problem or another control to read
HTML incredient please share with me.
Thanks in advance.

Feb 12 '06 #1
1 1081
Perhaps you could use HttpWebRequset.BeginGetResponse / EndGetResponse.
The entire response is returned but the call is asynchronous so you
would be able to do other processing while waiting for the callback...

ergun wrote:
Hi,

I wonder if there is a way to read only the first x bytes of a xml
responsetext. In my project I need only first 20-30 bytes of very large

HTML files and i don't want to wait for the rest to be read. Here is a
piece of code i use ;
Dim xml As New MSXML2.XMLHTTP
xml.Open "GET", address , False
xml.Send
MsgBox Left(CStr(xml.responseText),25), vbInformation, "Info..."

This code does the thing i want but i have to wait for all the body to
be read and only after that time i can parse the text. I want to stop
the process after 30. byte is read because of timing issues.

I also tried Inet control and saw a method like getChunk() which can
read the block mentioned but could not managed to use it.

If there is a way to overcome this problem or another control to read
HTML incredient please share with me.
Thanks in advance.

Feb 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Scott Brady Drummonds | last post by:
Hi, everyone, I'm a Python novice and would love some tips on how I should perform the following task: I'd like to have my Python script read objects (using their constructors) and terminate...
6
by: Dietrich Epp | last post by:
Are there any good modules for reading a bitstream? Specifically, I have a string and I want to be able to get the next N bits as an integer. Right now I'm using struct.unpack and bit operations,...
6
by: bart_nessux | last post by:
Hello, I have some Macbinary files on a PC. I want to recursively read these files and remove the first 128 bytes of the files if they contain the macbinary header info. I know how to read...
40
by: googler | last post by:
I'm trying to read from an input text file and print it out. I can do this by reading each character, but I want to implement it in a more efficient way. So I thought my program should read one...
3
by: Nick | last post by:
I have found a class that compresses and uncompresses data but need some help with how to use part of it below is the deflate method which compresses the string that I pass in, this works OK. At...
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
2
by: Mad Scientist Jr | last post by:
i'm trying to read a file byte by byte (and later alter the data and write it to a 2nd file byte by byte) and running into a problem where it seems to keep reading the same byte over and over again...
9
by: Macca | last post by:
Hi, I have a synchronous socket server which my app uses to read data from clients. To test this I have a simulated client that sends 100 byte packets. I have set up the socket server so...
16
by: Jm.GlezdeRueda | last post by:
Hi all, Im trying to read a 24bit bmp with fread, and i have some problems.. I want to read the whole structure in one time, but i dont know why, it only reads the first member well.. I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.