System.Diagnostics.Process on .net Microframework

Hi Have Some C#.net code I have to use this code for .net micro framework on Fez Cobra, The Problem is that System.Diagnostics.Process is not allowing me to use in .net micro framework below. Below is C#.net code, Actually I want to Execute a Console.exe from .net micro framework and it is giving some output from a device.

using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace CallBatchFile
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Process p = new Process();
p.StartInfo.FileName = “C:/Users/Jayesh Italiya/Desktop/Jayesh/console.exe”;
p.StartInfo.ErrorDialog = false;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.ErrorDataReceived += ConsoleDataReceived;
p.OutputDataReceived += ConsoleDataReceived;
if (p.Start())
{
p.BeginOutputReadLine();
p.BeginErrorReadLine();
p.StandardInput.WriteLine(“dir”);
p.StandardInput.WriteLine(“exit”);
p.WaitForExit();
}
}
static void ConsoleDataReceived(object sender, DataReceivedEventArgs e)
{
if (e.Data != null)
Console.WriteLine(e.Data);
Debug.Print(e.Data);
}
}
}

Please help me fast and Thanks in advance

May be you should have a look on what has been done for Pyxis by Skeeworks.

Using code tags will make your post more readable. This can be done in two ways:[ol]
Click the “101010” icon and paste your code between the

 tags or...
Select the code within your post and click the "101010" icon.[/ol]
(Generated by QuickReply)

Here’s some fast help.

You’re trying to use the .Net framework call on a .Net Micro device?

Please try to explain what you want to achieve. Remember, a .Net Micro board sits running off a power supply, all alone, not plugged into a PC all day. It does anything you tell it, but it can’t talk to your PC…

Eric thanks for you urgent reply

using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace CallBatchFile
{	
class Class1
{
[STAThread]
static void Main(string[] args)
{
Process p = new Process();
p.StartInfo.FileName = "C:/Users/Jayesh Italiya/Desktop/Jayesh/console.exe";
p.StartInfo.ErrorDialog = false;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true; 
p.ErrorDataReceived += ConsoleDataReceived;
p.OutputDataReceived += ConsoleDataReceived;
if (p.Start())
{
p.BeginOutputReadLine();
p.BeginErrorReadLine();
p.StandardInput.WriteLine("dir");
p.StandardInput.WriteLine("exit");
p.WaitForExit();
}
} 
static void ConsoleDataReceived(object sender, DataReceivedEventArgs e)
{
if (e.Data != null)
Console.WriteLine(e.Data);
Debug.Print(e.Data);
}
}
}

Thanks for reply Brett, ya you are right but I am going to include this files in project directory So I can use this without PC Also.

leforban thanks for your reply, But actually I am not getting what you are telling about.

May be it is because we don’t know exactly what you want to achieve. I was thinking that you wanted to have some information about the fez device, not about a computer connected to the device.

I suspect you’re approaching this all wrong then.

We REALLY need to understand what you’re trying to do to help you. If nothing else, you need to help us understand why you want the specific code construct, that does NOT apply to NETMF, in the NETMF portion of your project? It will never be possible to execute this on a NETMF device.