PC Review


Reply
Thread Tools Rate Thread

accessing values in html table

 
 
Jeff
Guest
Posts: n/a
 
      9th Mar 2008
hey

asp.net 3.5

I'm developing a webportal which need to access a webpage of a external
system. The external webpage contain a table which I want to retrieve the
values from.. it is a html table

my first aproach is to do like the code below, and then use several
if-statement to get the results I want:
string url = "<url>?Id=";
WebRequest request = WebRequest.Create(url + parameters["Id"]);
WebResponse response = request.GetResponse();
System.IO.Stream stream = response.GetResponseStream();
System.IO.StreamReader reader = new System.IO.StreamReader(stream);
string line;
System.Text.StringBuilder html = new System.Text.StringBuilder(40);
while ((line = reader.ReadLine()) != null)
{
if (line.Contains( criteria ))
{
html.Append(line);
}
}

but I wonder if there is a better approach?

any suggestions?


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HT retrieve values in html table from codebehind xzzy Microsoft ASP .NET 4 10th Mar 2007 08:28 AM
Accessing HTML text box values server side aspx Ryan Microsoft ASP .NET 3 1st Dec 2005 07:56 PM
Accessing HTML text box values server side aspx Ryan Microsoft ASP .NET 1 1st Dec 2005 09:22 AM
Pasting html table to Excel reformats certain values peter.krantz@gmail.com Microsoft Excel Discussion 1 20th Apr 2005 05:02 PM
Accessing last table at top level in HTML DOM John Williams Microsoft VB .NET 3 14th Oct 2004 03:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:49 PM.