Bonjour,
j'ai un petit souci pour rechercher un texte dans un fichier trop volumineux : 600~ Mo car il m'afficher un message d'erreur.
mon code de lecture :
message erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 Dim StartThreads As New Thread(Sub() Using fs As New FileStream(FilePath, FileMode.Open, FileAccess.Read, FileShare.Read) Using bs As New BufferedStream(fs) Using reader As New StreamReader(bs) While reader.Peek <> -1 If reader.ReadToEnd.Contains(TextBox1.Text) Then RichTextBox1.Invoke(Sub() RichTextBox1.AppendText(String.Format("Le texte ce trouver dans l'offset : {0} = {1} {2}", reader.BaseStream.Position, TextBox1.Text, Environment.NewLine))) End While End Using End Using End Using End Sub) StartThreads.Start()Pouvez-vous me dire comment puis faire pour rechercher un texte dans un fichier trop volumineux? merci d'avanceUne exception de type 'System.OutOfMemoryException' a été levée.
Partager