?
Solved

WIndows form application that obtains data from a web site.

Posted on 2011-03-02
3
Medium Priority
?
172 Views
Last Modified: 2012-05-11
Can someone point me to a sample project or article that explains how to obtain data from a website called from a windows form application?  I need to develop awindows form that will display news articals from a website.  Not sure if this should be done thorugh web service or .net remoting.  
0
Comment
Question by:Hojoformo
[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
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
anarki_jimbel earned 2000 total points
ID: 35023778
This is quite good link (basicly, my code is taken from it):

http://www.csharp411.com/read-a-web-page-in-c/

But, of course, you need to parse the content you get...
private void button2_Click(object sender, EventArgs e)
        {

            string url = "http://www.bbcworldnews.com/Pages/default.aspx";
            string result = null;

            try
            {
                System.Net.WebClient client = new System.Net.WebClient();
                result = client.DownloadString( url );
                System.Diagnostics.Debug.WriteLine(result);
            }
            catch (Exception ex)
            {
                // handle error
                MessageBox.Show( ex.Message );
            }

        }

Open in new window

0
 
LVL 30

Expert Comment

by:anarki_jimbel
ID: 35023791
You may also use Web browser on a form:

http://msdn.microsoft.com/en-us/library/2te2y1x6.aspx

But probably that's not what you want...
0
 
LVL 9

Expert Comment

by:rawinnlnx9
ID: 35023940
If the website does RSS and it surely must then all you need is an RSS aggregator. It's the right way to do it.

http://stackoverflow.com/questions/576267/c-rss-reader
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

777 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