Solved

WIndows form application that obtains data from a web site.

Posted on 2011-03-02
3
170 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 500 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 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