-
Notifications
You must be signed in to change notification settings - Fork 0
/
Zad7.cs
44 lines (32 loc) · 959 Bytes
/
Zad7.cs
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
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Zad2
{
class Program
{
static void Main(string[] args)
{
zad2();
Console.ReadKey();
}
static void zad2()
{
//ManualResetEvent manualEvent = new ManualResetEvent(false);
FileStream f =
new FileStream("TestFile.txt", FileMode.Open);
byte[] a = new byte[1024];
IAsyncResult result = f.BeginRead(a, 0, a.Length, null, null);
//dowolne operacje rownolegle do czytania
for (int i = 0; i < 100; i++)
Console.Write(i + " ");
int size = f.EndRead(result);
Console.WriteLine(Encoding.ASCII.GetString(a, 0, size));
//manualEvent.WaitOne(5000, false);
}
}
}