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?
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?