NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

using System;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;

namespace TimerApp
{
class Program
{
// Windows API kullanarak alarmı tetiklemek için gerekli tanımlamalar
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool SetSystemTime(ref SYSTEMTIME st);

[StructLayout(LayoutKind.Sequential)]
public struct SYSTEMTIME
{
public ushort Year;
public ushort Month;
public ushort DayOfWeek;
public ushort Day;
public ushort Hour;
public ushort Minute;
public ushort Second;
public ushort Milliseconds;
}

static void Main()
{
Console.WriteLine("Timer - Calendar-like app");

// Dil ayarlarını Türkçe olarak belirleme (isteğe bağlı)
Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("tr-TR");

Console.WriteLine("Enter the time for the timer (e.g. 1s20dk, 40mins):");
string timeInput = Console.ReadLine();

TimeSpan timeSpan;
if (TryParseTurkishTimeSpan(timeInput, out timeSpan))
{
Console.WriteLine("Timer started: " + timeSpan);

// Zamanlayıcıyı başlat
CountdownTimer(timeSpan);

// Timer sona erdiğinde alarmı tetikle
TriggerAlarm();
}
else
{
Console.WriteLine("Invalid time format");
}

Console.ReadKey();
}

// Türkçe zaman biçimini analiz etmek için özel işlev
static bool TryParseTurkishTimeSpan(string input, out TimeSpan timeSpan)
{
// Regex kullanarak saat, dakika ve saniye değerlerini alın
// Gerekirse daha karmaşık bir Regex deseni kullanabilirsiniz
string pattern = @"(d+)s*[sS](d+)s*[dD][kK]";
var regex = new Regex(pattern);
var match = regex.Match(input);

if (match.Success)
{
int minutes = int.Parse(match.Groups[1].Value);
int seconds = int.Parse(match.Groups[2].Value);
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.