beny100
Messages postés213Date d'inscriptionvendredi 17 novembre 2006StatutMembreDernière intervention 1 avril 2009
-
5 déc. 2006 à 17:08
beny100
Messages postés213Date d'inscriptionvendredi 17 novembre 2006StatutMembreDernière intervention 1 avril 2009
-
6 déc. 2006 à 10:50
bonsoir
j'ai un probleme d'execution de mon programme suivant
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Collections;
namespace fichier0
{
public partial class Form1 : Form
{
int i;
int a=0;
string Line = "";
string list;
string list1;
string[] split;
string[] split1;
string path = @"C:\alarme.txt";
string fich;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
using (StreamReader sr = File.OpenText(path))
while ((Line = sr.ReadLine()) != null)
{
i = i + 1;
if (Line.Contains("MINOR"))
{
split = Line.Split(' ');
list = (split[0] + split[1] + split[2]);
while ((Line = sr.ReadLine()) != null)
recherche();
}
else if (Line.Contains("MAJOR"))
{
split = Line.Split(' ');
list = split[0] + " " + split[1] + " " + split[2];
while ((Line = sr.ReadLine()) != null)
recherche();
}
else if (Line.Contains("CRITICAL"))
{
split = Line.Split(' ');
list = (split[0] + split[1] + split[2]);
while ((Line = sr.ReadLine()) != null)
recherche();
}
}
}
public void recherche()
{
if (Line.Contains("CLEARED"))
{
split1 = Line.Split(' ');
if (split[2] == split1[2])
{
list = (split[0] + split[1] + split[2] + split1[1]);
afficher();
}
else if (split[2] != split1[2])
recherche();
}
else
recherche();
a = 0;
}
public void afficher()
{
System.Console.WriteLine(list);
}
}
}
mon probleme est qu'il s'arrete a la ligne souligné et ecris le message suivant
la reference d'objet n'est pas definie à une instance 'un objet , je ne sais pas comment faire
aidez moi SVP