... | ... | @@ -18,13 +18,14 @@ class FileState |
|
|
{
|
|
|
using (FileStream fs = new FileStream(@"C:\Users\Jaehyun\Desktop\user.txt", FileMode.Open))
|
|
|
{
|
|
|
//synchronous call
|
|
|
byte[] buf = new byte[fs.Length];
|
|
|
fs.Read(buf, 0, buf.Length);
|
|
|
|
|
|
string txt = Encoding.UTF8.GetString(buf);
|
|
|
Console.WriteLine(txt);
|
|
|
|
|
|
// asynchronous call
|
|
|
//asynchronous call
|
|
|
FileState state = new FileState();
|
|
|
state.Buffer = new byte[fs.Length];
|
|
|
state.File = fs;
|
... | ... | |