Skip to content

Instantly share code, notes, and snippets.

@ierhalim
Created December 27, 2020 14:02
Show Gist options
  • Select an option

  • Save ierhalim/3be43f4813ae9d81c7cc4fc74c22584b to your computer and use it in GitHub Desktop.

Select an option

Save ierhalim/3be43f4813ae9d81c7cc4fc74c22584b to your computer and use it in GitHub Desktop.
Y3O1 Paralel programlama
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