School Commit Init
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.9.34622.214
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lab1", "Lab1\Lab1.csproj", "{5DDE8D84-CE84-4F12-A8DD-38B99E1BBAAF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{5DDE8D84-CE84-4F12-A8DD-38B99E1BBAAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5DDE8D84-CE84-4F12-A8DD-38B99E1BBAAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5DDE8D84-CE84-4F12-A8DD-38B99E1BBAAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5DDE8D84-CE84-4F12-A8DD-38B99E1BBAAF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {5D743BF4-E6DC-4DFA-B47E-523157CEBD69}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
namespace Lab1
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
private static System.Timers.Timer? aTimer;
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
aTimer = new System.Timers.Timer
|
||||
{
|
||||
Interval = 1000
|
||||
};
|
||||
aTimer.Elapsed += OnTimedEvent;
|
||||
aTimer.Start();
|
||||
Console.Read();
|
||||
return;
|
||||
}
|
||||
|
||||
public static void OnTimedEvent(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
var now = DateTime.UtcNow;
|
||||
Console.Clear();
|
||||
Console.WriteLine("Date:");
|
||||
Console.WriteLine($"Decimal: {now.Day:D2}/{now.Month:D2}/{now.Year:D4}");
|
||||
Console.WriteLine($"Hexa: {now.Day:X2}/{now.Month:X2}/{now.Year:X4}");
|
||||
Console.WriteLine($"Binary: {now.Day:b5}/{now.Month:b4}/{now.Year:b16}");
|
||||
Console.WriteLine("Time:");
|
||||
Console.WriteLine($"Decimal: {now.Hour:D2}:{now.Minute:D2}:{now.Second:D2}");
|
||||
Console.WriteLine($"Hexa: {now.Hour:X2}:{now.Minute:X2}:{now.Second:X2}");
|
||||
Console.WriteLine($"Binary: {now.Hour:b6}:{now.Minute:b6}:{now.Second:b6}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user