J'ai utilisé ce batch pour reproduire le comportement de nipper :
@echo off
ping localhost > NUL
echo ^<html^> > %4
echo Résulat = >> %4
type %2 | findstr /I toto >> %4
echo ^</html^> >> %4
Il génère une page HTML contenant "Résultat=" toutes les lignes contenant toto dans le fichier passé en entrée.
Et voici le code C# qui lance et affiche la page HTML générée.
Il y a webbowser et un bouton sur la form.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
namespace LaunchApp2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Process p = new Process();
p.StartInfo.FileName = "nipper";
p.StartInfo.Arguments = "-input config.txt -output out.html";
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.Start();
p.WaitForExit();
MessageBox.Show("Exécution terminée, affichage du résultat...");
webBrowser1.Navigate("file:///" + Directory.GetCurrentDirectory().Replace("\", "/") + "/out.html", false);
}
}
}