[C#] [StreamReader] probléme de lecture d'un fichier text
Bonjour,
je souhaite lire un fichier text avec un objet de la classe StreamReader, il me faut le lire X caractaire par X caractaire et les stockers dans des strings différentes (pour chaque groupe), j'ai assayer avec la methode read(char[],int,int) mais sa ne fonctione pas.
voici un extrait de mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| char[] tmp ;
string enregistrement_courant;
string code_enregistrement;
int position_a_lire = taille_enregistrement * nb_enregistrement_lue;
int i;
bool rib_ok = false;
bool fin_sequence = false;
do
{
tmp = new char[taille_enregistrement * 2];
istream.Read(tmp,position_a_lire,taille_enregistrement);
enregistrement_courant = new string(tmp);
[...]
}
while (!fin_sequence); |
quelqu'un a-t-il une solution ?
Merci de votre réponse