• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • Last Modified:

How can I read .html file in ASP.NET?

Hello experts,

I run a debating club.  An external windows app software pushes out debate results in a table in a .html file.

Is there a way that I can read this table so that I can place the values of each field in a database?

I have attached a pic of the .html table. Table in HTML file
Thank you

Vince
0
vstack
Asked:
vstack
2 Solutions
 
LeDaoukCommented:
familiar with vb.net?
0
 
LeDaoukCommented:
the code attached get the html tags to the string str
then you can manage it using mid(,,) function seraching for the html tag of each row
Dim web As New System.Net.WebClient()
            Dim url As String
            Dim d As Byte() = System.Text.Encoding.ASCII.GetBytes("")
            Dim res As Byte()
            Dim str As String

url = "http://www.blablabla.com"
                res = web.UploadData(url, "POST", d)
                str = System.Text.Encoding.ASCII.GetString(res)

Open in new window

0
 
SAMIR BHOGAYTAFreelancer and IT ConsultantCommented:
Hi, use this code

Add main namespace for this operation

using System.IO;

Read html file


string file = Server.MapPath ("abc.html");
StreamReader sr;
FileInfo fi = new FileInfo(file);
string input = "<pre>";
if(File.Exists(file))
{
     sr = File.OpenText(file);
     input += Server.HtmlEncode(sr.ReadToEnd());
     sr.Close();
}
input += "</pre>";
Label1.Text = input;

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
vstackAuthor Commented:
Thanks, I will try the solutions and let you know.

I appreciate your efforts
0
 
LeDaoukCommented:
welcome
0
 
jayulCommented:
You have do it easily by using seprate tag <COL NAME>
0
 
vstackAuthor Commented:
Thanks both solutions meet my needs.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now