Solved

WIndows form application that obtains data from a web site.

Posted on 2011-03-02
3
166 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
  • 2
3 Comments
 
LVL 29

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 29

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

896 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now