Solved

WIndows form application that obtains data from a web site.

Posted on 2011-03-02
3
165 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Article by: Ivo
Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

16 Experts available now in Live!

Get 1:1 Help Now