accessing values in html table

J

Jeff

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top