question
-
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
-
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
//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
-
//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