Solved

WIndows form application that obtains data from a web site.

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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