Hello I found this piece of code online and when I tried it it ddn't work could is it possible to know what directory in missing from my code?
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;
using Microsoft.SPOT.IO;
//using SecretLabs.NETMF.IO;
using System.IO;
namespace SD_CARD
{
public class SD_CARD
{
private static void main()
{
using (var filestream = new FileStream(@"SD\don't panic.txt", FileMode.Create))
{
StreamWriter streamWriter = new StreamWriter(filestream);
streamWriter.WriteLine("Hello Netduino!!!");
streamWriter.Close();
}
using (var filestream = new FileStream(@"SD\don't panic.txt", FileMode.Open))
{
StreamReader Reader = new StreamReader(filestream);
Debug.Print(Reader.ReadToEnd());
Reader.Close();
}
}
}
}
The bold text is the syntax errors I got after writing the code. I got 1 error which is about the missing reference to IO but don't know which one because when I add using secretlabs.netfm.io it doesn't find the dll file either, do I need to download it from somewhere?
Sorry about the long email but i really need to figure out how to use the usd and the netduino plus.
Syntax Errors
Started by MLW, Oct 14 2011 01:02 PM
5 replies to this topic
#1
Posted 14 October 2011 - 01:02 PM
#2
Posted 14 October 2011 - 05:39 PM
I think you are missing a reference - Add the System.IO to the references section of your project. You can also delete the other two IO using statements.
StreamReader Reader = new StreamReader(filestream);The bold text is the syntax errors I got after writing the code. I got 1 error which is about the missing reference to IO but don't know which one because when I add using secretlabs.netfm.io it doesn't find the dll file either, do I need to download it from somewhere?
Sorry about the long email but i really need to figure out how to use the usd and the netduino plus.
Hope this helps,
Mark
To be or not to be = 0xFF
Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life
Follow @nevynuk on Twitter
#3
Posted 15 October 2011 - 08:05 AM
I have a similar problem, i added a reference to system.io but system.io only has "Ports" and not "directory" or "filestream"
#4
Posted 15 October 2011 - 12:22 PM
Thank you Mark
It did work I thought I added it to references but officely it was missing
Mariam
#5
Posted 15 October 2011 - 04:05 PM
Hello scanman
I got it as soon as I added it to references it worked.
Did you add it to references in solution explorer?
Mariam
#6
Posted 15 October 2011 - 04:13 PM
Right click on the "References" folder inside the project's structure and add reference to System.IO
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users