Microsoft Trainer e Software Architect
Sviluppatore professionista dal 2001 con VB6, SQL 2000 e Access creando applicazioni gestionali di varia natura. Passando rapidamente a .NET, windows e web, ho poi espanso le mie esperienze su Compact Framework, SQL Server Mobile ed infine BizTalk Server.
Negli ultimi anni mi sono focalizzato sempre più sullo sviluppo distribuito ed enterprise conseguendo nel contempo le seguenti certificazioni:
Microsoft Certified Trainer (MCT)Microsoft MCPD .NET 3.5 Enterprise Applications DeveloperMicrosoft MCTS .NET 3.5 WCF Applications DevelopmentMicrosoft MCTS .NET 3.5 ASP.NET Applications DevelopmentMicrosoft MCTS .NET 3.5 ADO.NET Applications DevelopmentMicrosoft MCTS .NET 3.5 Windows Applications DevelopmentMicrosoft MCTS .NET 2.0 Distributed Applications DevelopmentMicrosoft MCP .NET
Ciao
anche se non è il massimo, a volte ci capita di dover leggere l’outout di una applicazione console (DOS)
un esempio pratico è il seguente:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics;
namespace ConsoleReaderApplication { class Program { private static Process p = new Process(); static void Main(string[] args) { p.StartInfo.FileName = "ConsoleOutputApplication.exe"; p.StartInfo.Arguments = "arg1 arg2"; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardError = true; p.StartInfo.UseShellExecute = false;
p.ErrorDataReceived += new DataReceivedEventHandler(p_ErrorDataReceived); p.OutputDataReceived += new DataReceivedEventHandler(p_OutputDataReceived);
p.Start(); p.BeginOutputReadLine(); p.BeginErrorReadLine();
Console.ReadLine(); p.Close(); }
static void p_OutputDataReceived(object sender, DataReceivedEventArgs e) { Console.WriteLine("Console: {0}", e.Data); }
static void p_ErrorDataReceived(object sender, DataReceivedEventArgs e) { Console.WriteLine("Error: {0}", e.Data); } } }
di fatto la classe Process ci offre la possibilità di leggere con degli eventi sia l’output dell’applicazione che un eventuale output di errore in modo molto semplice
è ovviamente consigliato usare un API se fornita, ma se dobbiamo dialogare con applicazioni molto datate o su altri linguaggi senza possibilità di usare servizi intermedi, allora questo è un approccio da valutare