İlk önce New Project > ConsoleApplication açınız. Aşağıdaki kodları ormunuza yazınız. Şekli inceleyin.

Şekil 1
using System;
using System.Collections.Generic;
using System.Text;
using System.Timers;
namespace gecensure
{
class Program
{
static void Main(string[] args)
{
Timer t = new Timer(1000);
t.Elapsed += new ElapsedEventHandler(zaman);
t.Elapsed += new ElapsedEventHandler(mesaj);
t.Start();
Console.ReadLine();
}
static void zaman(object o, ElapsedEventArgs a)
{
Console.WriteLine(DateTime.Now);
}
static void mesaj(object o, ElapsedEventArgs a)
{
Console.WriteLine("Geçen Süre:");
}
}
}
//Bir sonraki makalede görüşmek üzere. Bahadır ŞAHİN
using System;
using System.Collections.Generic;
using System.Text;
using System.Timers;
namespace gecensure
{
class Program
{
static void Main(string[] args)
{
Timer t = new Timer(1000);
t.Elapsed += new ElapsedEventHandler(zaman);
t.Elapsed += new ElapsedEventHandler(mesaj);
t.Start();
Console.ReadLine();
}
static void zaman(object o, ElapsedEventArgs a)
{
Console.WriteLine(DateTime.Now);
}
static void mesaj(object o, ElapsedEventArgs a)
{
Console.WriteLine("Geçen Süre:");
}
}
}
//Bir sonraki makalede görüşmek üzere. Bahadır ŞAHİN
0 comments:
Yorum Gönder