Created
December 27, 2020 14:02
-
-
Save ierhalim/3be43f4813ae9d81c7cc4fc74c22584b to your computer and use it in GitHub Desktop.
Y3O1 Paralel programlama
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.IO; | |
| using System.Threading; | |
| namespace LogWriter | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| string filePath = @$"{Path.GetTempPath()}\examplelog.txt"; | |
| if (!File.Exists(filePath)) | |
| { | |
| File.Create(filePath); | |
| } | |
| for (int i = 1000; i > 0; i--) | |
| { | |
| string message = $"Count down: {i}"; | |
| File.AppendAllText(filePath, $"{message}\n"); | |
| Console.WriteLine("Log added '{0}'", message); | |
| Thread.Sleep(10); | |
| } | |
| Console.ReadKey(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment