What to use instead of xmlhttp

Results 1 to 3 of 3

Thread: What to use instead of xmlhttp

  1. #1
    Join Date
    Dec 1969

    Default What to use instead of xmlhttp

    Is there a good dot net equivilent for xmlhttp? How do you use it to add a custom header, send a xml doc,(generated with the DOM) and get an xml doc back for further processing?<BR><BR>Or do I need to use xmlhttp? How do I get it into dotnet? How is it used in dot net?<BR><BR>I tried using webclient but had no luck getting it working.<BR><BR>Thanks.

  2. #2
    Join Date
    Dec 1969

    Default monthly feature in a magazine too...

    You should use a technique called "Screen Scrapping" which is featured in nice colorful pages in the June Edition of ASP.NETPRO magazine. <BR><BR>Buy it.. it&#039;s good. Here&#039;s a site with a general idea about it:<BR>http://www.codeproject.com/aspnet/weather.asp<BR><BR>Hope this helps you.<BR><BR>-Vadim C.

  3. #3
    Join Date
    Dec 1969

    Default That code is inefficient...

    It gets the data from the "scraped" HTML page one line at a time:<BR><BR>*****************<BR>StreamReader stream = new StreamReader(req.GetResponse().GetResponseStream() );<BR><BR>// Get the stream from the returned web response<BR>System.Text.StringBuilder sb = new System.Text.StringBuilder();<BR>string strLine;<BR>// Read the stream a line at a time and place each one<BR>// into the stringbuilder<BR>while( (strLine = stream.ReadLine()) != null )<BR>{<BR> // Ignore blank lines<BR> if(strLine.Length &#062; 0 )<BR> sb.Append(strLine);<BR>}<BR>*******************<BR ><BR>It would seem to me to be tons more efficient to use either the Read(char(),int,int) or the ReadToEnd( ) method on that Stream, rather than going a line at a time. If you were processing the text, on the fly, as you read one line at a time it would make sense. But since all that code does is rebuild the stream into a single String, anyway... Well, it doesn&#039;t make sense.<BR><BR>

Posting Permissions

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