Cant add refrences
#1
Posted 08 April 2012 - 05:09 AM
#2
Posted 08 April 2012 - 05:13 AM
#3
Posted 08 April 2012 - 06:01 AM
#4
Posted 08 April 2012 - 06:20 AM
#5
Posted 08 April 2012 - 06:20 AM
#6
Posted 08 April 2012 - 06:23 AM
#7
Posted 08 April 2012 - 06:27 AM
Sure thing. Pull in System.IO.dll.Is there a way to get filestream?
Chris
#8
Posted 08 April 2012 - 06:30 AM
#9
Posted 08 April 2012 - 06:31 AM
#10
Posted 08 April 2012 - 06:44 AM
#11
Posted 08 April 2012 - 06:45 AM
You can use System.Net.Sockets (or the HttpWebRequest class).My link is apparently a URI. Any ideas how to read it?
Take a look at the "SocketClint" sample in the .NET MF SDK.
Chris
#12
Posted 08 April 2012 - 06:48 AM
#14
Posted 08 April 2012 - 07:13 AM
#15
Posted 08 April 2012 - 07:27 AM
#16
Posted 08 April 2012 - 07:19 PM
Here is the code:
string url = "http://www.google.com/ig/api?stock=" + symbol; // used to build entire input StringBuilder sb = new StringBuilder(); // used on each read operation byte[] buf = new byte[8192]; // prepare the web page we will be asking for HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url); // execute the request HttpWebResponse response = (HttpWebResponse) request.GetResponse(); // we will read data via the response stream Stream resStream = response.GetResponseStream(); string tempString = null; int count = 0; do { // fill the buffer with data count = resStream.Read(buf, 0, buf.Length); // make sure we read some data if (count != 0) { // translate from bytes to ASCII text tempString = Encoding.ASCII.GetString(buf, 0, count); // continue building the string sb.Append(tempString); } } while (count > 0); // any more data to read? string temp = sb.ToString();
And here is the stringbuilder class.
using System; using Microsoft.SPOT; using System.Collections; namespace System.Text { class StringBuilder { ArrayList m_charArray = new ArrayList(); public StringBuilder() { } public StringBuilder(string value) : base() { Append(value); } public void Append(string value) { Char[] charArray = value.ToCharArray(); Append(charArray, 0, charArray.Length); } public void Append(char[] value, int startIndex, int charCount) { for (int index = startIndex; index < startIndex + charCount; index++) m_charArray.Add(value[index]); } public int Length { get { return m_charArray.Count; } } public override string ToString() { return new string((char[])m_charArray.ToArray(typeof(char))); } } }
#17
Posted 02 June 2012 - 06:44 PM
Can you explain "Pull in System.IO.dll"?Sure thing. Pull in System.IO.dll.
Chris
I am trying to write to an SD card on a Netduino Plus and I either get the error that I'm missing a namespace or dll, or when I go 'Project' -> 'Add Reference', I'm not sure what I'm supposed to do as there are a few tabs, but nothing that allows any adding of anything. I'm familiar with Eclipse, and Visual Studio is very new to me.
#18
Posted 02 June 2012 - 09:20 PM
Oh, no problem. Right click on your References folder in the Solution Explorer pane and then select "Add References...". Click on the first tab (.NET). Scroll down to "System.IO", select it, and press OK.Can you explain "Pull in System.IO.dll"?
I am trying to write to an SD card on a Netduino Plus and I either get the error that I'm missing a namespace or dll, or when I go 'Project' -> 'Add Reference', I'm not sure what I'm supposed to do as there are a few tabs, but nothing that allows any adding of anything. I'm familiar with Eclipse, and Visual Studio is very new to me.
Chris
#19
Posted 26 June 2012 - 10:54 PM
I don't have my netduino here yet so I write my code using the .netMF side and paste it into a .net program to simulate the results.
You can run your MF code against the emulator... would be a more reliable approach, too.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users