[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2011-03-17
7
Medium Priority
?
320 Views
Last Modified: 2012-05-11
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
Comment
Question by:vstack
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 4

Expert Comment

by:LeDaouk
ID: 35155418
familiar with vb.net?
0
 
LVL 4

Accepted Solution

by:
LeDaouk earned 1000 total points
ID: 35155442
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
 
LVL 11

Assisted Solution

by:SAMIR BHOGAYTA
SAMIR BHOGAYTA earned 1000 total points
ID: 35155661
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:vstack
ID: 35155923
Thanks, I will try the solutions and let you know.

I appreciate your efforts
0
 
LVL 4

Expert Comment

by:LeDaouk
ID: 35155932
welcome
0
 

Expert Comment

by:jayul
ID: 35163086
You have do it easily by using seprate tag <COL NAME>
0
 

Author Closing Comment

by:vstack
ID: 35164158
Thanks both solutions meet my needs.
0

Featured Post

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question