http://bansky.net/bl...ro-framework-2/
I am stuck with this routine, SaveFileOnDisk (see link), with the error, "The name 'Directory' (and also FileMode, FileAccess, FileShare) does not exist in the current context". I am referencing System.IO so I don't know what is wrong. This is the structure of my Program.cs with
ClrInfo.clrVersion: 4.1.2821.0
ClrInfo.clrVendorInfo: Netduino Plus (v4.1.1.0 b1 with extra RAM) by Secret La
using System; using System.Net; using System.Net.Sockets; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using System.IO.Ports; using System.IO; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.NetduinoPlus; namespace C328_Camera { public class Program { private C328R Camera; public static void Main() { C328R Camera; SerialPort mySerialPort = new SerialPort("COM1", 115200, Parity.None, 8, StopBits.None); Camera = new C328R(mySerialPort); } private void InitCamera() { . . . } private void SaveFileOnDisk(byte[] pictureData) { Directory.SetCurrentDirectory(@"\SD\"); <--ERROR // Some unique picture name based on time string pictureName = string.Concat( "IMG_", DateTime.Now.Hour.ToString(), DateTime.Now.Minute.ToString(), DateTime.Now.Second.ToString(), ".jpeg"); // Save the data into file using (FileStream fs = new FileStream(pictureName, <--ERROR FileMode.Create, <--ERROR FileAccess.Write, <--ERROR FileShare.ReadWrite))<--ERROR { fs.Write(pictureData, 0, pictureData.Length); fs.Close(); } } } }Thanks,
Baxter