1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
using(sr = new FileStream(_fichierLog, FileMode.Open, FileAccess.Read, FileShare.Read, 4096, true)) {
byte[] b = new byte[fi.Length];
textBoxLog.Clear();
while(sr.Read(b, Convert.ToInt32(_tailleLog), Convert.ToInt32(fi.Length)) > 0) {
textBoxLog.AppendText(temp.GetString(b));
}
}
using(sr = new StreamReader(_fichierLog, true)) {
String line;
textBoxLog.Clear();
while((line = sr.ReadLine()) != null) {
textBoxLog.AppendText(line + Environment.NewLine);
}
}
using (FileStream fs = File.OpenRead(_fichierLog)){
byte[] b = new byte[1024];
UTF8Encoding temp = new UTF8Encoding(true);
while (fs.Read(b,0,b.Length) > 0){
Console.WriteLine(temp.GetString(b));
}
}
FileInfo fi = new FileInfo(_fichierLog);
FileStream fs = fi.OpenRead();
byte[] arr;
fs.BeginRead(arr, 0, fi.Length, );
textBoxLog.Text = File.ReadAllText(_fichierLog); |
Partager