Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 132,154 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,817 people online right now. Registration is fast and FREE... Join Now!




Getting Stock Data

 
Reply to this topicStart new topic

Getting Stock Data

tree6014
post 9 Oct, 2008 - 01:33 PM
Post #1


New D.I.C Head

*
Joined: 30 Nov, 2007
Posts: 5


My Contributions


Hey, I am working on making a program that needs to be able to read in stock market data via the internet. I found that yahoo allows people to query their stock market data simply by requesting a URL such as http://finance.yahoo.com/d/quotes.csv?s=XO...&f=snd1l1yr A more detailed explanation of how it works is available at http://www.gummy-stuff.org/Yahoo-data.htm What this does is return a file with the raw data. I need to know how I can get my program to read the data directly from the internet into memory(variables). Any help is appreciated.

Thanks

This post has been edited by tree6014: 9 Oct, 2008 - 01:34 PM
User is offlineProfile CardPM

Go to the top of the page

modi123_1
post 10 Oct, 2008 - 12:34 PM
Post #2


D.I.C Addict

Group Icon
Joined: 12 Jun, 2008
Posts: 518



Thanked 10 times

Dream Kudos: 100
My Contributions


What have you tried so far?

I would use a nice memory stream.. but that's me.
User is online!Profile CardPM

Go to the top of the page

tree6014
post 10 Oct, 2008 - 01:10 PM
Post #3


New D.I.C Head

*
Joined: 30 Nov, 2007
Posts: 5


My Contributions


I tried a file stream; but, apparently you can't do that with a URL. I am also new to C# so I'm not yet familiar with all of its features. I've done most of my coding in C/C++ in the past. I'll look up memory streams and see if that works I suppose.
User is offlineProfile CardPM

Go to the top of the page

tree6014
post 10 Oct, 2008 - 02:50 PM
Post #4


New D.I.C Head

*
Joined: 30 Nov, 2007
Posts: 5


My Contributions


Alright, I got it to work by doing the following.

CODE

string data = String.Empty;
WebClient wc = new WebClient();
data = wc.DownloadString("URL");


Thanks for the advice.

This post has been edited by tree6014: 10 Oct, 2008 - 02:51 PM
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/21/08 01:50PM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month