Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- using System.Threading;
- namespace ConsoleApplication4
- {
- public class Program
- {
- public static object blokada = new object();
- static void Main(string[] args)
- {
- Thread t = new Thread(new ThreadStart(CosRobi));
- Thread t1 = new Thread(new ThreadStart(ciag));
- t1.Start();
- t.Start();
- Console.ReadKey();
- }
- static void ciag()
- {
- using (StreamWriter writer = new StreamWriter("important.txt"))
- {
- writer.Write("Wątek pierwszy: słowo z małych liter");
- }
- }
- static void CosRobi()
- {
- string line;
- string line2;
- using (StreamReader reader = new StreamReader("important.txt"))
- {
- line = reader.ReadLine();
- Console.WriteLine(line);
- }
- line2 = line.ToUpper();
- using (StreamWriter writer = new StreamWriter("important2.txt"))
- {
- writer.Write(line2);
- }
- Console.WriteLine("Wątek drugi - słowo powinno składać się z dużych liter: {0}", line2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement