Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. question

question

Scheduled Pinned Locked Moved C#
questioncsharpcomhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eyalso
    wrote on last edited by
    #1

    hi i need help - i need to save information (STOCKS information) from this site : http://today.reuters.com/stocks/Overview.aspx?ticker=msft i need to write a program in C# that get the information and print it Eyal eyalso

    A 1 Reply Last reply
    0
    • E eyalso

      hi i need help - i need to save information (STOCKS information) from this site : http://today.reuters.com/stocks/Overview.aspx?ticker=msft i need to write a program in C# that get the information and print it Eyal eyalso

      A Offline
      A Offline
      ajay_dalvi13
      wrote on last edited by
      #2

      //I have written the code on button click event. //You also try the same ..It works using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; using System.Net; private void button_Click(object sender, System.EventArgs e) { WebClient Client = new WebClient (); Stream strm = Client.OpenRead ("http://today.reuters.com/stocks/Overview.aspx ticker=msft"); StreamReader sr = new StreamReader(strm); string line = String.Empty ; //listbox1.Items.Clear(); // create a writer and open the file TextWriter tw = new StreamWriter(@"D:\date.xls"); } do { line = sr.ReadLine(); if(line==null) break; //listbox1.Items.Add(line); // write a line of text to the file tw.WriteLine(line); } while(line!=null); // MessageBox.Show(line); sr.Close(); strm.Close(); // close the stream tw.Close(); MessageBox.Show(@"File downloaded successfully at location D:\date.xls."); } Try this ...It works.. ajay_dalvi13@yahoo.co.in -- modified at 6:13 Friday 25th November, 2005

      E 1 Reply Last reply
      0
      • A ajay_dalvi13

        //I have written the code on button click event. //You also try the same ..It works using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; using System.Net; private void button_Click(object sender, System.EventArgs e) { WebClient Client = new WebClient (); Stream strm = Client.OpenRead ("http://today.reuters.com/stocks/Overview.aspx ticker=msft"); StreamReader sr = new StreamReader(strm); string line = String.Empty ; //listbox1.Items.Clear(); // create a writer and open the file TextWriter tw = new StreamWriter(@"D:\date.xls"); } do { line = sr.ReadLine(); if(line==null) break; //listbox1.Items.Add(line); // write a line of text to the file tw.WriteLine(line); } while(line!=null); // MessageBox.Show(line); sr.Close(); strm.Close(); // close the stream tw.Close(); MessageBox.Show(@"File downloaded successfully at location D:\date.xls."); } Try this ...It works.. ajay_dalvi13@yahoo.co.in -- modified at 6:13 Friday 25th November, 2005

        E Offline
        E Offline
        eyalso
        wrote on last edited by
        #3

        thanks eyalso

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups