Hi i have read this question :
Reading very large text files, should I be incorporating async?
I diged the net especially the STACK OVERFLOW !
The results was 14 method to do this but none of them is not complete !
In 2 last days , i am working on this and tested and benchmarked 14 methods.
for example :
private void method()
{
FileStream FS = new FileStream(path, FileMode.Open, FileAccess.ReadWrite);
int FSBytes = (int) FS.Length;
int ChunkSize = 24;
byte[] B = new byte[ChunkSize];
int Pos;
for (Pos = 0; Pos < (FSBytes - ChunkSize); Pos += ChunkSize)
{
FS.Read(B,0 , ChunkSize);
string content = System.Text.Encoding.Default.GetString(B);
richTextBox1.Text=content=;
}
B = new byte[FSBytes - Pos];
FS.Read(B,0, FSBytes - Pos);
string content2 = System.Text.Encoding.Default.GetString(B);
richTextBox1Text=content2;
FS.Close();
FS.Dispose();
}
for 5mb text file , it takes too long , what should i do ?